Open wtfiwtz opened 9 years ago
Actually I think this issue was caused by a missing parameter to curl: --header "Content-Type:application/json"
The error message is something like No suitable method found. URL 'api/v1/sample/persons' and HTTP method POST
AbstractRestResource<JsonWebSerialDeserial>
is now the best object for JSON - notGsonSerialDeserial
.I mention this because I just spent quite a while trying to work out why a
POST
request was not working.HttpUtils.readStringFromRequest( )
returns an empty string on Tomcat (as the getReader() has already been emptied).Hopefully this saves someone else some time.
Correct example code here:
https://github.com/wicketstuff/core/blob/master/jdk-1.7-parent/wicketstuff-restannotations-parent/restannotations-examples/src/main/java/org/wicketstuff/rest/resource/PersonsRestResource.java
Sample POST request for me using
curl
:Where data.txt is something like: {'name': 'string'}
Cheers, Nigel