Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Sending XML over HTTP  RSS feed

 
Jyotishman Pathak
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

This may be a dumb question, but could anyone tell me how to send XML files over HTTP?

Thanks,
Jyoti
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming you want to transfer XML data to a servlet, you can use java.net.URLConnection on the client (which makes its output stream available to you to write to), and on the servlet side you use request.getInputStream to access the data you posted. Make sure you use a POST, not a GET, and that you don't call getParameter first, because that will make the stream unusable.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!