Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to consume and parse JSON in the REST?  RSS feed

 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends..

How to parse JSON data consumed in the REST (use Jersey)?..
what i need is, the ease way to get the value sent by client..
is it usual thing to send JSON data format instead of XML data format in the REST?..

Thanks in advance..
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer involves JAXB, and is demonstrated in one of the Jersey samples called "json-from-jaxb". It shows how REST services can both send and receive JSON.
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf Dittmer, Thanks for your reply..

yes, REST could consume JSON data type..
but, what i mean is..
assume that i succeed send data to REST, and then in the Server side (REST) how to get the values sent by client...
because the data is in JSON format..
is it any easy way to get the values that had been sent by the client?..

Thanks in advance..
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the example I mentioned; it shows all that in action.
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok.. Thanks Ulf..
i'll check out it..
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!