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 xml in request using spring rest template with post method

 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have to send xml with request for post method using spring rest template.I tried to find some code from Google but i could not.
Can anyone let me know any working code example by which i can send xml(post method) using spring rest template.


Thanks
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you looked at the reference documentation?
http://static.springsource.org/spring/docs/3.2.1.RELEASE/spring-framework-reference/htmlsingle/#rest-client-access

There is a postForObject(...) postForLocation(...) and exchange(...) method that can all be used depending on your needs. Please have a look and give these a try. If you have problems post back with what you have tried and we will see if we can help you.
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bill
After few attempts i am able to write code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic