Specifying HTTP referer in embedded UIWebView
In my app, I allow the user to open up an external page in an embedded UIWebView. Is it possible for me to set the referer header that's sent with that request? I'd like for my app to get the 'cred' when the user opens up these external pages. Set the referer using - setValue:forHTTPHeaderField: NSMutableURLRequest* request = ...; [request setValue:@"https://myapp.com" forHTTPHeaderField: @"Referer"]; But note that according to the HTTP RFC you shouldn't, because your app is not addressable using a URI: The Referer field MUST NOT be sent if the Request-URI was obtained from a source that does