From 4923f5cc0f9e21abe18339197f9e03fe27387ead Mon Sep 17 00:00:00 2001 From: Joel Wurtz Date: Thu, 28 Jul 2016 23:08:03 +0200 Subject: [PATCH] Add a warning about missing headers on the request --- clients/socket-client.rst | 11 +++++++++++ spelling_word_list.txt | 1 + 2 files changed, 12 insertions(+) diff --git a/clients/socket-client.rst b/clients/socket-client.rst index 66e5895..4b1c0c4 100644 --- a/clients/socket-client.rst +++ b/clients/socket-client.rst @@ -63,4 +63,15 @@ use case would be:: ]; $client = new Client($messageFactory, $options); +.. warning:: + + This client assumes that the request is compliant with HTTP 2.0, 1.1 or 1.0 standard. So a request without a ``Host`` header, or + with a body but without a ``Content-Length`` will certainly fail. + To make sure all requests will be sent out correctly, we recommend to use the ``PluginClient`` with the following plugins: + + * ``ContentLengthPlugin`` sets the correct ``Content-Length`` header, or decorate the stream to use chunked encoding + * ``DecoderPlugin`` decodes encoding coming from the response (chunked, gzip, deflate and compress) + + :doc:`Read more on plugins ` + .. include:: includes/further-reading-sync.inc diff --git a/spelling_word_list.txt b/spelling_word_list.txt index a1946c1..68458eb 100644 --- a/spelling_word_list.txt +++ b/spelling_word_list.txt @@ -3,6 +3,7 @@ auth backtrace boolean callables +chunked cURL Diactoros Elasticsearch