• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using a REST API with Java  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I want to write some Java which will query a REST API which returns JSON.
What do I need to learn to be able to send requests to the API, get authorisation and deal with the response.
I have been searching but so far I haven't found a simple example of this where I can get started ?
I would really appreciate being pointed in the right direction.

Kieron

 
Saloon Keeper
Posts: 4038
94
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The standard Java REST API is called JAX-RS, and its reference implementation is called Jersey. The Jersey web site has lots of documentation, including example code and introductions.
 
Greenhorn
Posts: 2
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think OP wants to consume a REST API, not create it.
In such case you will need an HTTP client. I like Retrofit, it makes things easy with a really clean approach. http://square.github.io/retrofit/
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!