I am sending emails from my iPhone app by calling a web service and in the email body I need to send a URL that contains an ampersand symbol (&). If I use the symbol in my URL the web service does not send the email, but if I remove that ampersand symbol everything works and the webservice sends the email just fine. So my question is, should I use the ASCII eqiva开发者_如何学Pythonlent of that symbol ? And if so, what is the ASCII eqivalent for '&'? Can any one help me?
This is my URL which has the ampersand symbol
http://xx.xxx.1.xx/xxx/aspxapprvcontrct.aspx?PartyEMail=xx@xxxx.com&devid= 1xx23
Thanks in advance.
You need to escape the whole string (email body) you are sending to your webservice. This question has been asked before on SO, see the link included below. I got it from the link @Caleb included, which in and of itself does not solve your particular problem. I would recommend looking at the second answer posted by @Michael Waterfall.
Objective C HTML escape/unescape
精彩评论