2

As a followup to this question, I cannot get this to work so I need to take a step back I think.

Can someone post some sample code on how to post XML to a rest service WITHOUT using params? Is it even possible? Basically I have an object with several properties, and I convert this to XML and then need to upload it. But it fails if there is an image converted to string in the XML. Without that it works fine.

Even a JSON example would be helpful...

Totally blocked here :P

Community
  • 1
  • 1
Nicros
  • 5,031
  • 12
  • 57
  • 101

1 Answers1

4

Use NSMutableURLRequest -setHTTPBody:, and set the Content-Type HTTP header to application/xml.

If you're doing this consistently, you may want to consider subclassing AFHTTPClient to add an XML parameter serialization option.

mattt
  • 19,544
  • 7
  • 73
  • 84