Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Unsupported Media Exception  RSS feed

Mike London
Ranch Hand
Posts: 1476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

My service has code like the code below, which works fine testing the POST from the Intellij Rest test environment.

The XML Request comes in as a String.

public StreamingOutput createCustomer(InputStream is) throws IOException
Customer customer = readCustomer(is);
customerDB.put(customer.getId(), customer);

StreamingOutput custValue = getCustomer(1);

return custValue;

The output, in Intellij, after the POST, in Intellij's REST Explorer, is:

<customer id="1">
<street>256 Clarendon Street</street>

Hurray, but ....


YET, if I do the exact same Request and same URL in Firefox's "RESTCLIENT", I get:

Status Code: 415 Unsupported Media Type
Content-Length: 0
Date: Wed, 26 Feb 2014 16:45:25 GMT
Server: Apache-Coyote/1.1

What gives?

Do I need to return a particular type for the RESTCLIENT in FireFox to read the response or am I missing something else?

Thanks in advance,

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