views:

27

answers:

1

Simplified code example: http://pastebin.com/9ZQxSXi9

Hi

I wanted to experiment with the restlet 2.0 library and the gpodder webservice but somehow i reached a point where I can't see the wood for the trees. The service in the example requires HTTP authentication and to post some JSON content to a URL. Nothing that complicated but somehow even though the debug view claims the request object to contain the necessary content the RESTful webservice's response leads me to believe the HTTP header of the request was missing the content.

Any ideas on what's the reason? Thanks in advance.

A: 

Your HTTP request is missing a Content-length header.

It seems that Restlet doesn't append the Content-length header in an HTTP request when the restlet httpclient extension is missing from the classpath.

Try adding the HTTPClient extension jar file in your classpath.

Source: http://osdir.com/ml/java.restlet/2007-07/msg00128.html

More on the Reslet HTTP client connector: http://www.restlet.org/documentation/1.0/connectors#httpclient

Vivien Barousse
Thanks, but the following jar files are already part of the test project's build path:org.restlet.jar | org.restlet.ext.httpclient.jar | org.restlet.ext.json.jar | org.apache.httpclient.jar | org.apache.httpcore.jar | org.apache.commons.logging.jar | BTW: Retrieving simple JSON content via GET from a similar service worked fine.
mz_01