Re: query language

hello lászló.

On 2014-09-10, 11:22 , László Lajos Jánszky wrote:
>> using POST in this case because GET has the issues with not being very request-body-friendly
> POST would violate the cache constraint, and it is possibly against
> the HTTP method definitions, since GET is for data retrieval.

using POST does not violate anything here, it simply removes the 
possibility for optimization. it's a pragmatic (and legitimate) choice 
if you want to send what logically would be a GET request, but you need 
to send a body as well.

>> very complex requests at some point often do not even fit into URIs anymore.
> I have serious doubts about this. AFAIK I need more than 1000
> characters to exceed the max length of query strings. Currently by URI
> templates even simple nested statements are not supported...

queries come in all shapes and forms. when working with image processing 
scenarios, queries can even contain images ("find all pictures similar 
to this one") or other media.

also, keep in mind that URI template is not a query language. it is a 
way how a resource can expose the way in which requests are supposed to 
be constructed. it has been purposefully kept simple (and many claim it 
should have been quite a bit simpler than it ended up being) to hit the 
80/20 point. maybe you're in the 20%, and then you're out of luck.

>> not every problem needs to be hammered with the same hammer. if you have complex and maybe even domain-specific ways how you interact with a resource, create your own media type for it that supports these interactions.
> I fail to see why should I create an own media type, since I cannot
> send body with a GET request.

if interactions with your service require representations that are not 
adequately covered by generic standards, then it makes sense to use your 
own, or work towards some domain standard. that's what makes the web 
open and extensible. if you think you don't need that, then don't do it.

cheers,

dret.

-- 
erik wilde | mailto:dret@berkeley.edu  -  tel:+1-510-2061079 |
            | UC Berkeley  -  School of Information (ISchool) |
            | http://dret.net/netdret http://twitter.com/dret |

Received on Wednesday, 10 September 2014 18:34:51 UTC