• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can't send StringEntity to RESTlet resource  RSS feed

james frain
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!