I am working on one project in which I am preparing API to interact with server from iPhone.
I have created API with POST parameter xmlrequest and in that parameter, I am passing xml content.
Everything is working correctly, except, when in xml content if any special character comes, it cuts off on server side.
My question is should I apply any header/content type on both sides, if yes, Can I get example ?
EDIT:
It is an issue of special character, in xml content I tried to replace “&” with “and” and it worked, but when I try to replace “&” with “&”, it does not work.
In HTTP, GET- and POST- parameters are seperated with the special characters
?,&and=. I’m sure you already have seen things like that in URLS:example.com?foo=bar&meow=woofYour server will parse the query-string, and it assumes that everytime a
&appears, it’s a new parameter. So, in order to pass such a special character, you first need to URL-encode it (on the iPhone-side). For example, the space-character, URL-encoded, would be%20.You can then decode the URL-encoded string on server side using
urldecode()andrawurldecode().