きれいな要求/応答ヘッダーと本文データを記録できるカールフラグの組み合わせはありますか?

きれいな要求/応答ヘッダーと本文データを記録できるカールフラグの組み合わせはありますか?

カーリングの兆候がたくさんあります。スタック交換サイトの多くの回答では、以下をお勧めします。

--verbose but it displays a lot of network related data and certificates and handshakes, and it does not show the request body
--header it only shows headers, and only response headers
--trace-ascii this shows the body, but not in a human-readable format
-i only shows the response headers and body, but it's clean
-D only shows the response headers
...

私が望むのは、要求/応答ヘッダーと本文の簡単なログです。

私の要求ではありませんmultipart/form-data。私の要求は、単純なJSONデータまたはキーと値のペアを送受信することです。

基本的に私に必要なのは次のログです。

curl api.example.com -d '{"name":"somboeyd"}'

***************

request headers
one empty line
request body

***************

response headers
one empty line
response body

ロゴを混ぜて作れますか?それ以外の場合はカール操作を実行しますが、このクリーンログを使用するコマンドラインユーティリティはありますか?

ベストアンサー1

私が見つけたHTTPieそれは完璧です。

これは私が使用するコマンドです:

http --follow --verbose POST https://api.example.com Content-Type:application/json key1=value1 key2=value2

そして優れた出力を持っています。カールは過去に属します。

おすすめ記事