如何查看PHP cURL请求主体(如CURLINFO_HEADER_OUT作为标题) [英] How to view PHP cURL request body (like CURLINFO_HEADER_OUT for headers)
问题描述
我可以使用以下命令查看使用php curl发送的请求的标头:
I can view the headers of a request sent using php curl with the following:
curl_getinfo($ch, CURLINFO_HEADER_OUT);
我也希望看到正在发送的内容,但不能终生
I wish to see the body of what is being sent out as well but cannot for the life of me find any way to do so.
推荐答案
在广泛搜索PHP cURL文档后,我找不到任何这样的选项。
I was unable to find any such option after extensively searching the PHP cURL documentation.
我的解决方案是使用网络代理工具查尔斯
My solution was to use the web proxy tool Charles
Charles是HTTP代理/ HTTP监视器/反向代理,使开发人员能够查看他们之间的所有HTTP和SSL / HTTPS流量机器和互联网。这包括请求,响应和HTTP标头(包含cookie和缓存信息)。
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 cURL请求主体(如CURLINFO_HEADER_OUT作为标题)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!