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

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -