Error which occures from the server: Warning: file_get_contents(https://api.twitch.tv/kraken/user?client_id=abcd&authorization=OAuth+rojwncsqlhard627ho1yer41eqj1za) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 401 Unauthorized in /mnt/web-data1/symbiant_cz/public_html/developer/projects/dgi/ares/aresak.php on line 1106
It is written in Php of course.
I think it doesn’t have some header or something, it’s called from simple file_get_contents tho.
Tell me what causes this, and how to fix this thank you.
The reason as to why it’s working when you’re pasting it in your browser is because you’re logged in to Twitch on your browser. If you were to open an incognito window it would stop working.
You’re setting up your parameters incorrectly though.
Authorization: OAuth -key- is if you’re using a HTTP header.
I would also suggest changing your oauth_token now too, as you’ve just shared it publicly. (Even though you’ve blurred out your email in your paste, it’s viewable from the URL).