我可以通过以下方式查看使用 php curl 发送的请求的 header :
curl_getinfo($ch, CURLINFO_HEADER_OUT);
我也希望看到正在发送的内容的主体,但我无法找到任何方法。
最佳答案
在广泛搜索 PHP cURL 文档后,我无法找到任何此类选项。
我的解决方案是使用网络代理工具 Charles
Charles is an HTTP proxy / HTTP monitor / Reverse Proxy that enables a developer to view all of the HTTP and SSL / HTTPS traffic between their machine and the Internet. This includes requests, responses and the HTTP headers (which contain the cookies and caching information).
关于php - 如何查看 PHP cURL 请求正文(如 header 的 CURLINFO_HEADER_OUT),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34348132/