PDT returning 423 as first line before success?

2019-09-16 02:36发布

问题:

I'm trying to get PDT working in the sandbox, and have just run afoul of the problem of using HTTP 1.1 as described here:

https://stackoverflow.com/a/14701946/391615

Having changed everything, when I create my connection to

$fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30);
fputs ($fp, $header . $req);

// read the body data 
$res = '';
while (!feof($fp)) 
{
    $line = fgets ($fp, 1024);
    // etc...

I find that the very first lines return look like this:

423
SUCCESS
mc_gross=240.00
invoice=PP0000
protection_eligibility=Partially+Eligible+-+INR+Only
address_status=unconfirmed

Any idea what the 423 is all about?

回答1:

Well here we go: PHP fsockopen() / fread() returns messed up data

Looks like it's chunked data being returned from the server