Hey all,
There's a thread on the users list from someone trying to build a Groovy client to the REST API. The typical way of talking to HTTP services in Groovy is the HTTPBuilder wrapper around Apache HTTPClient, and it appears to make some assumptions (in particular, that requests will always have a content-type.) It seems like we could accommodate that fairly easily, by ensuring some sufficiently bland content-type is used for the empty-body responses in the REST API. (By bland I mean unlikely to cause clients to try to parse the content. I think we could go with text/plain, but I have seen it recommended that REST APIs define custom mime types for all their messages so that might be a good idea too.)
--
David Winslow
OpenGeo - http://opengeo.org/
Part of the problem is that the REST api does not return anything when it probably should. For instance when new resources are created it makes sense to send back the "default" representation of the created resource.
That said, I guess there still will be instances where there is an empty response. So yeah, +1 on setting a default content type.
Do you have the doc handy that references sending back a custom mime type as a REST best practice?
David Winslow wrote:
Hey all,
There's a thread on the users list from someone trying to build a Groovy client to the REST API. The typical way of talking to HTTP services in Groovy is the HTTPBuilder wrapper around Apache HTTPClient, and it appears to make some assumptions (in particular, that requests will always have a content-type.) It seems like we could accommodate that fairly easily, by ensuring some sufficiently bland content-type is used for the empty-body responses in the REST API. (By bland I mean unlikely to cause clients to try to parse the content. I think we could go with text/plain, but I have seen it recommended that REST APIs define custom mime types for all their messages so that might be a good idea too.)
--
David Winslow
OpenGeo - http://opengeo.org/
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
I wasn't able to find the article I had in mind, but found this blog post which talks about it a bit (search for "Media Types."
http://www.littlefyr.com/articles/2009/02/13/rest-in-a-nutshell-part-1/
I had to dig a bit to find it though; there seems to be lots of conflicting advice across the web regarding this topic.
--
David Winslow
OpenGeo - http://opengeo.org/
On 11/05/2009 07:46 PM, Justin Deoliveira wrote:
Part of the problem is that the REST api does not return anything when
it probably should. For instance when new resources are created it makes
sense to send back the "default" representation of the created resource.
That said, I guess there still will be instances where there is an empty
response. So yeah, +1 on setting a default content type.
Do you have the doc handy that references sending back a custom mime
type as a REST best practice?
David Winslow wrote:
Hey all,
There's a thread on the users list from someone trying to build a Groovy
client to the REST API. The typical way of talking to HTTP services in
Groovy is the HTTPBuilder wrapper around Apache HTTPClient, and it
appears to make some assumptions (in particular, that requests will
always have a content-type.) It seems like we could accommodate that
fairly easily, by ensuring some sufficiently bland content-type is used
for the empty-body responses in the REST API. (By bland I mean unlikely
to cause clients to try to parse the content. I think we could go with
text/plain, but I have seen it recommended that REST APIs define custom
mime types for all their messages so that might be a good idea too.)
--
David Winslow
OpenGeo - http://opengeo.org/
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel