This commit is contained in:
Jakub Roztocil 2016-03-10 14:27:33 +08:00
parent 35a99fe04b
commit 7c68d87c10
2 changed files with 18 additions and 18 deletions

View File

@ -15,8 +15,8 @@ This project adheres to `Semantic Versioning <http://semver.org/>`_.
* Added JSON detection with ``--json, -j`` to work around incorrect * Added JSON detection with ``--json, -j`` to work around incorrect
``Content-Type`` ``Content-Type``
* Added ``--all`` to show intermediate responses such as redirects (with ``--follow``) * Added ``--all`` to show intermediate responses such as redirects (with ``--follow``)
* Added ``--print-others, -P WHAT`` * Added ``--print-others, -P WHAT`` to specify formatting of intermediate responses
* Added ``--max-redirects`` (default 30) * Added ``--max-redirects=N`` (default 30)
* Added ``-A`` as short name for ``--auth-type`` * Added ``-A`` as short name for ``--auth-type``
* Added ``-F`` as short name for ``--follow`` * Added ``-F`` as short name for ``--follow``
* Removed the ``implicit_content_type`` config option * Removed the ``implicit_content_type`` config option

View File

@ -821,10 +821,10 @@ the HTTP exchange:
========== ================== ========== ==================
Character Stands for Character Stands for
========== ================== ========== ==================
``H`` Request headers. ``H`` request headers
``B`` Request body. ``B`` request body
``h`` Response headers. ``h`` response headers
``b`` Response body. ``b`` response body
========== ================== ========== ==================
Print request and response headers: Print request and response headers:
@ -838,27 +838,27 @@ Print request and response headers:
Viewing Intermediary Requests/Responses Viewing Intermediary Requests/Responses
--------------------------------------- ---------------------------------------
If you'd like to see any intermediary requests/responses together with the To see any intermediary requests/responses together with the final one,
final one, then use the ``--all`` option. Intermediary requests include use the ``--all`` option. Intermediary requests include followed redirects
followed redirects (with ``--follow``), the first unauthorized request when (with ``--follow``), the first unauthorized request when HTTP digest
Digest auth is used (``--auth=digest``), etc. They are by default also authentication is used (``--auth=digest``), etc.
formatted according to ``--print, -p`` (and its shortcuts described above),
which can be customized with ``--print-others, -P`` which takes the same
arguments as ``--print, -p`` but applies to the intermediary requests only.
View all responses that lead to the final one:
.. code-block:: bash .. code-block:: bash
# Include all responses that lead to the final one:
$ http --all --follow httpbin.org/redirect/3 $ http --all --follow httpbin.org/redirect/3
Print the final and the intermediary requests/responses differently: The intermediary requests/response are by default formatted according to
``--print, -p`` (and its shortcuts described above). If you'd like to change
that, use the ``--print-others, -P`` option. It takes the same
arguments as ``--print, -p`` but applies to the intermediary requests only.
.. code-block:: bash .. code-block:: bash
$ http --all --follow --print=hH --print-others=H httpbin.org/redirect/3 # Print the intermediary requests/responses differently than the final one:
$ http -A digest -a foo:bar --all -p Hh -P H httpbin.org/digest-auth/auth/foo/bar
------------------------- -------------------------