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

How to send the request and retrieve response

 
K Kiran Kumar
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can anyone suggest some API's for the following:
I have a sample URL (https://confluence.cornell.edu/display/culpublic/Display+search+results+from+the+CUL+web+page+GSA+collection), where in if I send a request to the server, the server will send the xml response.
My queries are:
(1) How to send the URL request by code (Not by servlets, but by core java)
(2) How to retrieve the XML data sent by the server in an object.

Regards,
Kiran.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the standard Java library we have the java.net package for doing this kind of thing. If your request succeeds you will get your XML as a InputStream suitable for parsing.

Bill
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic