How to print NSMutableURLRequest using NSLog ?
.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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With