• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

third party API URL how to send request and get response

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 43
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You save more money with a clothesline than dozens of light bulb purchases. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic