Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print NSMutableURLRequest?

How to print NSMutableURLRequest using NSLog ?

like image 777
Krishna Chaitanya Bandaru Avatar asked Apr 26 '11 06:04

Krishna Chaitanya Bandaru


Video Answer


1 Answers

.allHTTPHeaderFields returns a dictionary with the header content:

NSLog(@"%@", [request allHTTPHeaderFields]); // { //    "Accept-Language" = "en;q=1"; //    "Content-Length" = 190706; //    "Content-Type" = "multipart/form-data; boundary=Boundary+D90A259975186725"; //    "User-Agent" = "..."; // } 

Or for specific field:

NSString *field = @"Content-Type"; NSLog(@"%@",[request valueForHTTPHeaderField:field]); // multipart/form-data; boundary=Boundary+D90A259975186725 
like image 176
visakh7 Avatar answered Oct 06 '22 13:10

visakh7