[web2py] Re: Recommended strategy for passing complex query parameters to a REST API

2015-05-27 Thread Massimo Di Pierro
I assume what you mean by rest principles is that you want to do a GET and not a POST. Problem is some browsers (for example IE) have limits on the size of the path_info in GET methods. So if you do not care about that you can do .../api/available_resources?query={...} where query here is a u

Re: [web2py] Re: Recommended strategy for passing complex query parameters to a REST API

2015-05-22 Thread Derek
you can also simply urlencode it. as json... ?searchcriteria={'date':'5/31/2015','locations':[{'location_name':'Los+Angeles','attendees':10,'services':['Housekeeping','Catering']},{'location_name':'New+York','attendees':5,'services':['Housekeeping']}],'duration':60} On Friday, May 22, 2015 at 3:4

Re: [web2py] Re: Recommended strategy for passing complex query parameters to a REST API

2015-05-22 Thread Michele Comitini
In REST you can use any data encoding. I suppose Kevin referst to OData ( https://en.wikipedia.org/wiki/Open_Data_Protocol#A_sample_OData_JSON_data_payload) and needs to use GET and not POST, since that is a query not an insertion (PUT) or a modification (POST). I do not know if OData is apt to mak

[web2py] Re: Recommended strategy for passing complex query parameters to a REST API

2015-05-21 Thread Dave S
On Thursday, May 21, 2015 at 8:42:12 PM UTC-7, ke...@amplifieddevelopment.net wrote: > > Thanks, Massimo. I can see how that would work well in the web2py > environment. > > In our organization, however, we have heterogeneous systems that use REST > interfaces to share data. So, I am hoping

[web2py] Re: Recommended strategy for passing complex query parameters to a REST API

2015-05-21 Thread kevin
Thanks, Massimo. I can see how that would work well in the web2py environment. In our organization, however, we have heterogeneous systems that use REST interfaces to share data. So, I am hoping to find a solution that aligns as closely as possible with REST principles. On Tuesday, May 19,

[web2py] Re: Recommended strategy for passing complex query parameters to a REST API

2015-05-19 Thread Massimo Di Pierro
Hello Kevin, the best way is to make an Ajax request with content type 'application/json' and put the JSON search_criteria into the HTTP request body. For example: curl -H "Content-Type: application/json" - X POST -d "{...}" http:///mypage where {...} is your JSON object. Then in the web2p

[web2py] Re: Recommended strategy for passing complex query parameters to a REST API

2015-05-19 Thread Ron Chatterjee
I have to say, things like this, you can do very well using mongodb. Because its json like structure. And then use lower level pymongo to do search.find_one(). Idk how DAL will handle such dbase setup. On Tuesday, May 19, 2015 at 8:50:22 PM UTC-4, ke...@amplifieddevelopment.net wrote: > > We