本文介绍了在Evernote中收到411错误的错误请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有三个环境,分别是Dev,QA和Prod.

我们有一个运行稳定的PHP,可以与evernote连接,获取令牌并获取内容.

我们将质量检查环境更新为PHP 7.0,现在当我们通过Evernote尝试获取令牌时会返回

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

这是代码

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

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

我已经检查了consumerKey等,并且一切正确.

我不确定这里会出现什么错误,因为411通常是在您需要发送内容长度时,但是在Evernote API中,他们没有提到类似的内容

这是由于PHP 7.0吗?

任何帮助将不胜感激

谢谢

解决方案

是的,您可能需要发送内容长度. Evernote会更改Content-Length的API验证吗?

我看到在 Github 上提出了另一种解决方法./p>

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

解决方案

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.

这篇关于在Evernote中收到411错误的错误请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 04:18