简体   繁体   中英

Yahoo Fantasy Sports API not authenticating

I am at the beginning stages of fiddling with Yahoo's Fantasy Sports API as described here. https://developer.yahoo.com/fantasysports/guide/ However on literally the first step, I it is not working.

I have the PHP Sample Code in a file to ensure everything is connected to Yahoo and working, but it does not work. I get the following error.

Couldn't open /tmp/oauth_data_token_storage_\\comsumerkey\\.out, assuming we need to get a new request token. Better try to get a new access token. Invalid auth/bad request (got a 411, expected HTTP/1.1 20X or a redirect) Full OAuth Flow without Libraries ¶ If the PHP library described above doesn't fit your needs, you may feel like implementing the flow yourself. It's mildly tricky and you may run into common issues like not sorting the parameters correctly, or not encoding the various parts of the URL at the right time. The following script is an example of doing absolutely everything from scratch, and may be a useful guide for you. Could not retrieve request token data

My app has been created on the developer.yahoo.com site and where in the code above \\comsumerkey\\ is where my consumer key is located at.

Why am I getting a 411 response. Sounds like there is something outdated with the code from this guide.

You are receiving the HTTP 411 status code because the server expects the Content-Length header in your request. Yahoo definitely uses the 411 code in this way, indicated in this document for their Social API.

The sample code you are using simply is not sending the header. You will need to do so yourself by calculating the length of your content manually and sending it using the header function , or alternatively by finding a script that performs the authentication correctly for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM