• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

Can't send StringEntity to RESTlet resource

Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

Hey! Wanna see my flashlight? It looks like this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic