After a POST request with curl, the status code is received, and the result is 0, but the data returned by the request is normal.
After the check, it is the execution order problem:
$response = [ ' statusCode ' = curl_getinfo ($curl, Curlinfo_http_code), ' body ' = curl_exec ($curl), ' curlerrorcode ' = Curl_errno ($curl), ];
Because later change the structure, so did not care about the position of the curl_exec, the direct adjustment is used, so in the output, the value has been 0
After the adjustment is good, that is, should execute the $CURL request, and then to obtain the requested status code and other related parameters (no problem), because it was placed outside the array received, so there is no problem
$response = [ ' body ' = = curl_exec ($curl), ' curlerrorcode ' = ' Curl_errno ($curl), ' StatusCode ' = Curl_getinfo ($curl, Curlinfo_http_code), ];
So we need to pay attention to the details and understand the principle of the problem.
Curl HTTP Code 0