1
0
mirror of https://github.com/httpie/cli.git synced 2025-06-04 23:27:28 +02:00

Update README.rst

This commit is contained in:
Jakub Roztocil 2020-08-19 10:30:40 +02:00
parent 69445c106c
commit 743f9738a3

View File

@ -723,40 +723,42 @@ By default, HTTPie uses a random unique string as the boundary but you can use
.. code-block:: bash .. code-block:: bash
$ http --form --multipart --boundary=XOXO --offline example.org hello=world $ http --form --multipart --boundary=xoxo --offline example.org hello=world
.. code-block:: http .. code-block:: http
POST / HTTP/1.1 POST / HTTP/1.1
Content-Length: 129 Content-Length: 129
Content-Type: multipart/form-data; boundary=XOXO Content-Type: multipart/form-data; boundary=xoxo
Host: example.org Host: example.org
--XOXO --xoxo
Content-Disposition: form-data; name="hello" Content-Disposition: form-data; name="hello"
world world
--XOXO-- --xoxo--
If you specify a custom ``Content-Type`` header without including the boundary If you specify a custom ``Content-Type`` header without including the boundary
bit, HTTPie will add the boundary value (specified or generated) to the header bit, HTTPie will add the boundary value (specified or generated) to the header
automatically: automatically:
.. code-block:: bash .. code-block:: bash
http --form --multipart --boundary=XOXO --offline example.org hello=world Content-Type:love/letter
http --form --multipart --offline example.org hello=world Content-Type:multipart/letter
.. code-block:: http .. code-block:: http
POST / HTTP/1.1 POST / HTTP/1.1
Content-Length: 129 Content-Length: 129
Content-Type: love/letter; boundary=XOXO Content-Type: multipart/letter; boundary=c31279ab254f40aeb06df32b433cbccb
Host: example.org Host: example.org
--XOXO --multipart/letter
Content-Disposition: form-data; name="hello" Content-Disposition: form-data; name="hello"
world world
--XOXO-- --multipart/letter--
HTTP headers HTTP headers