Echo curl 请求标头 &身体不送吗? [英] Echo curl request header & body without sending it?

查看:18
本文介绍了Echo curl 请求标头 &身体不送吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 curl 命令行工具,是否可以echo、打印或查看请求而不发送它?有点像 -n 选项?我想查看请求标头 &身体,以及包括在内的任何其他东西.除了 header & 之外,还有什么可以发送的吗?身体?

With the curl command line tool, is it possible to echo, print, or view the request, and not send it? Sort of like a -n option? I would like to see the request header & body, and anything else that's included. Is there anything else that's sent besides header & body?

推荐答案

让我再次建议使用 'nc' (netcat) 来查看所有详细信息,而无需将任何内容发送到任何异地.

Let me second the suggestion to use 'nc' (netcat) to get to see all the details without sending anything offsite to anywhere.

但是您也可以使用 --trace--trace-ascii 可以转储所有传入和传出数据以及检查请求的命令.

But you can also get all the details for any curl command line request by using the --trace or --trace-ascii commands that can dump all incoming and outgoing data and requests for inspection.

与 'nc' 相比,这些选项还有一个额外的好处,即它们可以显示协议详细信息,即使是 HTTPS 操作和真实"命令行等.

These options have the additional benefit in comparison to 'nc' that they can show the protocol details even for HTTPS operations and with "real" command lines etc.

这篇关于Echo curl 请求标头 &身体不送吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆