Page 1 of 1

REST query URI

Posted: Mon Dec 19, 2011 9:24 pm
by dsimmeth

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.


REST query URI

Posted: Mon Dec 19, 2011 9:26 pm
by maxkatz

Yes, the URL would be like this: .../items/{size}. Then create 'size' input parameters for the service.


REST query URI

Posted: Wed Aug 13, 2014 1:50 am
by B510

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


REST query URI

Posted: Wed Aug 13, 2014 3:15 am
by Yurii Orishchuk

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.


REST query URI

Posted: Wed Aug 13, 2014 4:17 am
by B510

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; 
         }

REST query URI

Posted: Mon Jul 20, 2020 12:29 pm
by Yurii Orishchuk

{\""invoiceno\"":\""inv100\""}]}"" }