php - 如何查看 PHP cURL 请求正文(如 header 的 CURLINFO_HEADER_OUT)

标签 php curl

我可以通过以下方式查看使用 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/

相关文章:

php - 使用 Laravel 5.5 如何通过迁移复制表中的列?

PHP::Emulate <form method ="post">, 将用户转发到页面

php - php内存释放如何依赖于硬件?

php - CURL 不保存 Cookie (PHP)

php - 扩展用于发布到页面的 Facebook Open Graph token

PHP子论坛内子论坛的树形遍历

PHP 不发布由 jQuery 生成的文本框值

php - 使用 AJAX 调用 PHP 函数,但重定向不起作用

php - 如何在 Laravel 中按特定值排序?

带有端口号问题的 PHP Curl