Getting 411 error bad request in Evernote

2019-07-25 18:52发布

问题:

We have three environments, Dev, QA and Prod.

We have a stable PHP running that connects with evernote , get token and fetch content.

we updated our QA environment to PHP 7.0 and now when via evernote when we try to fetch Token it returns

Invalid auth\/bad request (got a 411, expected HTTP\/1.1 20X or a redirect)

Here is the code

 $oauth = new \OAuth($this->consumerKey, $this->consumerSecret);

        return $oauth->getRequestToken($this->getEndpoint('oauth'), $callbackUrl);

I have checked that consumerKey etc and everything is correct.

I am not sure what error could be here since 411 is normally when you need to send content length, but in Evernote API they dont mention anything like this

Is this due to PHP 7.0 ?

Any help will be appreciated

Thanks

回答1:

Yes, you probably need to send the content length. Does Evernote change the API validation for the Content-Length?

I see there is another workaround proposed on Github.