REST - Body Parameters in POST Method

Posted by terlas on 21-May-2013 07:14


I have defined two REST methods, GET and POST (See images attached).

GET it's working fine and response is OK. The problem is in POST because of web parameters. I'm using restClient for Firefox.

This is the wadl.

<application xmlns="" xmlns:xs="">
<resources base="">
<resource path="/Producte">
<method name="GET">
<param name="piCodProd" style="query" default="" type="xs:string"/>
<response status="204"/>
<method name="POST">
<response status="204"/>

I'm trying to call service via POST method with the URL "http://{myIP}:8080/Project/rest/Producte/Producte", and in Body:


This should be insert de "ProductOne" Product in database but I have this error.

  1. Status Code: 415 Unsupported Media Type
  2. Content-Length: 0
  3. Date: Tue, 21 May 2013 12:09:34 GMT
  4. Server: Apache-Coyote/1.1

Can anyone tell me what I'm doing wrong?




All Replies

Posted by bronco on 06-Aug-2013 09:34

I'm running into the same problem, the "415, unsupported media type". Did you solve it somehow?

I get this when I want to test my REST service from PostMan, which is a Chrome app for HTTP calls.

Posted by Peter Judge on 06-Aug-2013 09:39

Is the Content-Type header set correctly to application/json?

Posted by bronco on 06-Aug-2013 10:00

I thought the tool did, but apparently not. Setting the Content-Type header "manually" did he trick. Thanks!

This thread is closed