I am using objective C JSON parsing library. My web service returns the JSON response. My parser fails as there is an '\' character in the response string. The response string is like ":\/\/68.491.5.780\/iphoneapplication"
but I want to be like "://68.491.5.780/"
.
My code is here:
NSURL *url=[NSURL URLWithString:
@"http:// url address/Accountservice/Security/ValidateAccess?accesscode=abcd&type=0"];
NSData *postData =
[post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:postData];
So how can I remove all back slash "\" in the response receive from web service?