Can I call a REST service that does not user query parameters but rather uses the URI? In other words, /items/large instead of /items?size=large
It seems that the REST mapping only supports REST query parameters.
Can I call a REST service that does not user query parameters but rather uses the URI? In other words, /items/large instead of /items?size=large
It seems that the REST mapping only supports REST query parameters.
Yes, the URL would be like this: .../items/{size}. Then create 'size' input parameters for the service.
Hello Max,
Could you please advise, what should I put in URI parameters if I want to REST Query the following:
string data = "where={'$and': [{'id_users': 'john'},{'invoiceno': 'inv100'}]}";
please help
thanks a lot in advance
Hi B510,
You don't need to pass anything in URI when you use Appery.io REST API querying.
See details about how you should pass "where" clause in request here: http://devcenter.appery.io/documentat...
Also, if you have some problem with it, please make screen shots and describe them to be clear about your issue.
Regards.
Hello Yurii,
Thank you.. what I don't understand is where should I put the 'where' clause ( I am using C#)?
== got from the link you gave,,
curl -X GET
-H "X-Appery-Database-Id: 526fdbd8e4b07c3286b537f1"
-G
--data-urlencode 'where={"subtask": {"collName":"todo", "_id":"5278ef66e4b01085e4b79482"}}'
https://api.appery.io/rest/1/db/colle...
====
public string MakeRequestFind(string parameters)
{
var request = (HttpWebRequest)WebRequest.Create(EndPoint + parameters);
request.Headers.Add("X-Appery-Database-Id", CONST.APPERYIO_DATABASE_ID);
request.Method = Method.ToString();
request.ContentLength = 0;
request.ContentType = ContentType;
request.Accept = "/";
using (var response = (HttpWebResponse)request.GetResponse())
{
var responseValue = string.Empty;
Code: Select all
if (response.StatusCode != HttpStatusCode.OK)
{
var message = String.Format("Request failed. Received HTTP {0}", response.StatusCode);
throw new ApplicationException(message);
}
// grab the response
using (var responseStream = response.GetResponseStream())
{
if (responseStream != null)
using (var reader = new StreamReader(responseStream))
{
responseValue = reader.ReadToEnd();
}
}
return responseValue;
}
{\""invoiceno\"":\""inv100\""}]}"" }