From c9c6f0fae59b284757b3b7fafade32b668abd0c5 Mon Sep 17 00:00:00 2001 From: Jakub Roztocil Date: Wed, 30 May 2018 14:02:46 +0200 Subject: [PATCH] Formatting --- README.rst | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 50f527cb..546a426b 100644 --- a/README.rst +++ b/README.rst @@ -652,14 +652,41 @@ HTTPie does not offer any special syntax for specifying cookies — the usual ``Header:Value`` notation is used: +Send a single cookie: + .. code-block:: bash - # Send a single cookie: $ http example.org Cookie:sessionid=foo - # Send multiple cookies (quoted to prevent the shell from interpreting the ';'): +.. code-block:: http + + GET / HTTP/1.1 + Accept: */* + Accept-Encoding: gzip, deflate + Connection: keep-alive + Cookie: sessionid=foo + Host: example.org + User-Agent: HTTPie/0.9.9 + + +Send multiple cookies +(note the header is quoted to prevent the shell from interpreting the ``;``): + +.. code-block:: bash + $ http example.org 'Cookie:sessionid=foo;another-cookie=bar' +.. code-block:: http + + GET / HTTP/1.1 + Accept: */* + Accept-Encoding: gzip, deflate + Connection: keep-alive + Cookie: sessionid=foo;another-cookie=bar + Host: example.org + User-Agent: HTTPie/0.9.9 + + If you often deal with cookies in your requests, then chances are you'd appreciate the `sessions`_ feature.