Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

third party API URL how to send request and get response

 
senthil kumar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a third party API URL in which if i enter the parameters, i get the response as an xml in the browser.

I want to use this API URL in my java application so that i can pass my request and get the response and use it my application.

How can i achieve this in java, the API URL can return three different response formats, like JSONP, JSON and XML.

Any ideas/suggestions could highly help me.

Thanks
Senthil
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java standard library has always been powerful in this area so you don't necessarily need a special API.

Look at the java.net package classes such as HttpURLConnection.

Bill
 
Rajitha Gunawardhane
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you like to deal with JSON. I think will be much easier. You can use a library like https://code.google.com/p/google-gson.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic