Getting 411 error bad request in Evernote

做~自己de王妃 提交于 2019-12-11 05:45:44

问题


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.



来源:https://stackoverflow.com/questions/43791876/getting-411-error-bad-request-in-evernote

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!