HTTP POST 不起作用(408 错误)

发布于 2024-10-21 02:05:24 字数 931 浏览 2 评论 0原文

我在尝试从支付提供商 (WorldPay) 向我的主机服务器发送发布请求时遇到一些问题。基本上,如果/当交易成功时,WorldPay 会对我网站上的脚本进行回调。问题是 post 请求没有到达我的脚本 – 我们只是得到 408 超时。

这是从 WorldPay 发送的请求,如下:

POST /index.php?route=payment/worldpay/callback HTTP/1.0
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Host: www.mysite.com
Content-Length: 711
User-Agent: WJHRO/1.0 (WorldPay Java HTTP Request Object)

authAmountString=%26%23163%3B3.49&_SP.charEnc=UTF-8&desc=testItem&authMode=A

这是从我的主机服务器发回的响应:

HTTP/1.1 408 Request Timeout
Connection: Close
Pragma: no-cache
cache-control: no-cache
Content-Type: text/html; charset=iso-8859-1

我知道这是一个不太可能的情况,但有人能看出上面的内容有什么问题吗?为了简化事情,我用基本的 html 输出替换了 php 脚本,该输出返回了 hello world 消息,但我们仍然得到了 408,所以我很确定该脚本可以工作。我们也遇到过一两次这样的错误:

failed CAUSED BY invalid HTTP status line: >null<

非常感谢任何帮助

干杯

保罗

I am having some problems trying to get a post request to work from a payment provider (WorldPay) to my host server. Basically WorldPay does a callback to a script on my website if/when a transaction is successful. Problem is the post request isn’t getting to my script – we just get a 408 timeout.

This is the request sent from WorldPay below:

POST /index.php?route=payment/worldpay/callback HTTP/1.0
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Host: www.mysite.com
Content-Length: 711
User-Agent: WJHRO/1.0 (WorldPay Java HTTP Request Object)

authAmountString=%26%23163%3B3.49&_SP.charEnc=UTF-8&desc=testItem&authMode=A

And this is the response sent back from my hosts server:

HTTP/1.1 408 Request Timeout
Connection: Close
Pragma: no-cache
cache-control: no-cache
Content-Type: text/html; charset=iso-8859-1

I know this is a long shot but can anyone see anything wrong with anything above? To simplify things i replaced the php script with a basic html output which returned a hello world message and we still got a 408 so i’m pretty sure the script works. We have also had this error once or twice:

failed CAUSED BY invalid HTTP status line: >null<

Any help is greatly appreciated

Cheers

Paul

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

唯憾梦倾城 2024-10-28 02:05:24

如果你上面给出的HTTP请求是准确的,那么看起来好像客户端正在广播711字节的内容长度,但是实体主体似乎不是711字节长。这就是服务器等待其余数据超时的原因。

If the HTTP request you gave above is accurate, it seems as if the client is advertising a content length of 711 bytes, but the entity body does not seem to be 711 bytes long. That is why the server is timing out waiting for the rest of the data.

自演自醉 2024-10-28 02:05:24

HTTP/1.1 408请求超时,

注意服务器配置,如果你的主机服务器是nginx,可以检查nginx.conf中的“client_body_timeout”

HTTP/1.1 408 Request Timeout,

pay attention to server config, if your host server is nginx, you can check "client_body_timeout" in nginx.conf

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文