I have some media files on a server that are meant not to be public. They require the presence of a custom HTTP header in the request otherwise the server will just redirect to a 404 page.
I can set this custom header easily using UIWebView and NSMutableURLRequest, but I'd like to be able to open the request in Safari as well. Unfortunately it seems that the only way to open Safari is by invoking it with a simple URL with no opportunity for setting headers.
Does anyone know if there is any way to open a request in Safari with custom HTTP headers?
Thanks.
I have not come across that feature in any browser.
You could however create an HTML page that you put on the same server, with a textfield where the user can enter a password, and then use XMLHttpRequest.setRequestHeader() to send that password to your server in an HTTP header.
It's not as straightforward as entering a URL into the address bar, so I'm not sure if that's an option for you.
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