Base64 HTTP Authenthication
How can I get the contents of a URL using base64 authentication (username:password) with the iPhone SDK
Passing the username and password in the URL doesn't work because the API states that the authentication is basi开发者_JS百科c web authentication, using base64 encryption of "username:password"
I hope somebody can help me out with this one.
Thanks in advance!
Ok I've managed to figure it out. You have to set the correct Authorization value in the header and this will do the trick :D
You do realize that since you are sending the password in base64, you might as well just send it in plain text, right? You should store anything you wouldn't want someone else to see in base64 due to it's very simple nature.
精彩评论