aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes third party API URL how to send request and get response Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "third party API URL how to send request and get response" Watch "third party API URL how to send request and get response" New topic
Author

third party API URL how to send request and get response

senthil kumar
Greenhorn

Joined: Mar 19, 2008
Posts: 15
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

Joined: Mar 22, 2000
Posts: 12671
    
    5
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

Java Resources at www.wbrogden.com
Rajitha Gunawardhane
Greenhorn

Joined: Dec 11, 2007
Posts: 28
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: third party API URL how to send request and get response
 
Similar Threads
Problem regarding URLConnection
How do I send XML message in POST body
how to invoke my servlet from a third party web client
How to read response code in a jsp
Problem with sendRedirect