且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PayPal IPN 错误请求 400 错误

更新时间:2022-06-27 07:05:28

由于您是自己打开套接字,而不是使用 curl 等 HTTP 库,因此您需要设置正确的 HTTP 协议版本并添加 HTTP 主机标头位于 POST 行下方.

Since you're opening the socket yourself, rather than using an HTTP library such as curl, you need to set the proper HTTP Protocol version and add the HTTP Host header yourself just below the POST line.

$header = "POST /cgi-bin/webscr HTTP/1.1
";
$header .= "Host: www.sandbox.paypal.com
";