Skip to content

Commit 833ea08

Browse files
committed
Show example of separate display of the response, referring to new issue #120.
1 parent f9a6118 commit 833ea08

2 files changed

Lines changed: 33 additions & 10 deletions

File tree

docs/index.rst

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,9 @@ The following example is of external sources.
5151
5252
To display the response outside of the tabbed interface, then don't include it in the ``http:example`` directive, but instead list it separately.
5353

54-
For inline sources, use ``code-block`` with the ``http`` lexer.
55-
56-
.. code-block:: rst
57-
58-
.. http:example:: space separated list of tools
59-
A required inline source of a raw plain text HTTP request example.
60-
This is required.
61-
62-
.. code-block:: http
63-
An optional inline source of a raw plain text HTTP response example.
54+
.. note::
55+
Currently only external sources support a separate display of the HTTP response.
56+
The users of sphinxcontrib.httpexample would appreciate a contribution to add this feature as indicated in `issue 120 <https://github.com/collective/sphinxcontrib-httpexample/issues/120>`_.
6457

6558
For external sources, use ``literalinclude`` with the ``http`` lexer.
6659

docs/usage.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,36 @@ Result
404404
:request: ../tests/fixtures/001.request.txt
405405
:response: ../tests/fixtures/001.response.txt
406406

407+
408+
Separate response
409+
^^^^^^^^^^^^^^^^^
410+
The following example is exactly the same as the previous one, except the HTTP response is displayed separately from the tabbed interface.
411+
412+
.. note::
413+
Currently only external sources support a separate display of the HTTP response.
414+
The users of sphinxcontrib.httpexample would appreciate a contribution to add this feature as indicated in `issue 120 <https://github.com/collective/sphinxcontrib-httpexample/issues/120>`_.
415+
416+
Markup
417+
``````
418+
419+
.. code-block:: rst
420+
421+
.. http:example:: curl wget httpie requests plone-client
422+
:request: ../tests/fixtures/001.request.txt
423+
424+
.. literalinclude:: ../tests/fixtures/001.response.txt
425+
:language: http
426+
427+
Result
428+
``````
429+
430+
.. http:example:: curl wget httpie requests plone-client
431+
:request: ../tests/fixtures/001.request.txt
432+
433+
.. literalinclude:: ../tests/fixtures/001.response.txt
434+
:language: http
435+
436+
407437
HTTP ``POST``
408438
^^^^^^^^^^^^^
409439

0 commit comments

Comments
 (0)