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.
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.
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