Skip to content

Instantly share code, notes, and snippets.

@yasirmturk
Last active December 21, 2015 10:38
Show Gist options
  • Save yasirmturk/6292786 to your computer and use it in GitHub Desktop.
Save yasirmturk/6292786 to your computer and use it in GitHub Desktop.
Log the complete ASIHTTPRequest HTTP Request
/*
* Log the complete ASIHTTPRequest HTTP Request
*/
+ (void)logRequest:(ASIHTTPRequest *)request{
NSLog(@"url:%@", request.url);
NSLog(@"method:%@", request.requestMethod);
NSLog(@"head:%@", request.requestHeaders);
if (request.postLength > 0) {
NSLog(@"body:%@", [[NSString alloc]initWithBytes:[request.postBody bytes] length:request.postLength encoding:NSUTF8StringEncoding]);
}
NSLog(@"responseString:%@", request.responseString);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment