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.
Share
Set the referer using – setValue:forHTTPHeaderField:
But note that according to the HTTP RFC you shouldn’t, because your app is not addressable using a URI:
… unless you are using a custom protocol binded to your app (myapp://blah.com/blah).
You can create one and call loadRequest: manually or intercepting a normal request made by the user.