I am trying to create a connection to a URL that prints out JSON code that is then parsed and processed. My URL has a parameter called bypass
. The URL looks like this:
http://www.getchanged.net/json.asp?bypass=MIGCBgkrBgEEAYI3WAOxxx
I did not manage to solve this issue as it always says Connection failed with error: cannot parse response
NSURL *aUrl = [NSURL URLWithString:@"http://www.getchanged.net/json.asp"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:aUrl cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];
[request setHTTPMethod:@"GET"];
NSString *postString = @"bypass=MIGCBgkrBgEEAYI3WAOxxx";
[request setHTTPBody:[postString dataUsingEncoding:NSUTF8StringEncoding]];
Error:
2014-10-29 21:43:39.529 TestMap[57987:1931535] Connection failed with error: cannot parse response
What is wrong here?
Please note: I replaced the bypass hash a bit because it contains sensible data. The website works and is printing out JSON output.