I'm sending a JSON to an API. When the API receives a JSON, it responds by telling me whether the procedure was successful or not. How do I get this answer?
Shipping code:
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://www.meuSite.com.br/api/listener.php"]];
[request setHTTPMethod:@"POST"];
[request setValue:@"text/json" forHTTPHeaderField:@"Content-type"];
[request setValue:[NSString stringWithFormat:@"%d", [_json length]] forHTTPHeaderField:@"Content-length"];
[request setHTTPBody:[_json dataUsingEncoding:NSUTF8StringEncoding]];
[[NSURLConnection alloc] initWithRequest: request delegate:self];