aspose file tools
The moose likes Web Services and the fly likes Can't send StringEntity to RESTlet resource Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "Can Watch "Can New topic
Author

Can't send StringEntity to RESTlet resource

james frain
Ranch Hand

Joined: Apr 06, 2011
Posts: 36
This is last chance saloon for me, spent days trying to get to the bottom of this
here is the problem. If I include anything other than a "" blank string ( eg entity = new StringRequestEntity("abc", "text/plain", "UTF-8"); )in the entity then the request fails with the error message "Unsupported Media Type"
I have tried multiple different content types but can never seem to get past this
With just a blank string the POST gets to the resource handler.
Looking at the documentation it is the server that is throwing this error back because it does not have any resource that can handle plain text, so how do I set up my resource to do this?

My resource

 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Can't send StringEntity to RESTlet resource
 
Similar Threads
Best Practice to send a request to 2 destinations?
reason for EOF exception?
Measuring Time in Multi-threaded Application Using "System.currentTimeMillis()"
Trying to POST an XML to php based Web Service via HTTP POST method
How to provide basic authetication from SOAP request to access SAP XI service