How To Send & Symbol In Xml Body To Server
I am trying to send the & symbol to the server in an XML body but only received a blank. I tried HTML code to send this also but in vain.
Solution 1:
You can create a category on NSString
and then encode few characters that you cant send directly... few are implemented below:
@implementation NSString (URLEncoding)
- (NSString *) stringByUrlEncoding{
return (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)self, NULL, (CFStringRef)@"!*'();:@&;=+$,/?%#[]", kCFStringEncodingUTF8));
}
@end
Post a Comment for "How To Send & Symbol In Xml Body To Server"