我在 PHP 中使用 cURL 发送 JSON 请求。在验证错误时,我遇到的 API 将返回 400 错误。如果我使用 chrome 扩展 Postman,我会看到此处显示的代码的整个状态:http: //i.imgur.com/QMi5vX9.png
但是,当我使用 cURL 发布时,这是我从 curl_getinfo 收到的内容:
(
[url] => https://**sensitive**/
[content_type] =>
[http_code] => 400
[header_size] => 157
[request_size] => 315
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.929666
[namelookup_time] => 0.000949
[connect_time] => 0.201551
[pretransfer_time] => 0.741269
[size_upload] => 173
[size_download] => 0
[speed_download] => 0
[speed_upload] => 186
[download_content_length] => 0
[upload_content_length] => 0
[starttransfer_time] => 0.929631
[redirect_time] => 0
[certinfo] => Array
(
)
)
有没有办法从 cURL 获取整个状态消息?