how can i convert NSURLRequest to NSString ?
NSURLRequest *urlRequest;
...
NSLog(@"%@", [urlRequest allHTTPHeaderFields]);
NSLog(@"%@",[urlRequest valueForHTTPHeaderField:field]);
In this example, urlRequest is an NSURLrequest (from the previous example above). The second line allows you to print the value of a specific field 'field' that has been added to the NSURLRequest.
From Apple docs
- (NSString *)valueForHTTPHeaderField:(NSString *)field Parameters
field
The name of the header field whose value is to be returned. In keeping with the HTTP RFC, HTTP header field names are case-insensitive.
Return Value
The value associated with the header field field, or nil if there is no corresponding header field.