java - Application/JSON is Unsupported Media Type in restful webservice -
java - Application/JSON is Unsupported Media Type in restful webservice -
i trying create restful-jersey webservice. have pass json object webservice.
@post @path("/savevehicletrackingdata") @consumes(mediatype.application_json) @produces(mediatype.text_plain) public string savevehicletrackingdata(vehicletracking vehicletracking) { homecoming vehicletracking.tostring(); }
when seek try create request service, says http status 415 - unsupported media type. please help. also, should type of single argument of method savevehicletrackingdata.
ps: using postman create http request. http://goo.gl/vwxnxq
update : pointed out peeskillet, missing thing here json provider. next challenge have is, how integrate json provider in project. after researching little, found fasterxml jackson 1 of json provider.
this image reference. had post.
basically when utilize raw, default text/plain
. json in drop down, select syntax highlighting. still need set content-type
header application/json
. can click on headers button , add together it.
java json rest jersey
Comments
Post a Comment