Skip to content

Commit f489ef5

Browse files
committed
Add a warning about missing headers on the request
1 parent c9f46eb commit f489ef5

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

clients/socket-client.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,16 @@ use case would be::
6363
];
6464
$client = new Client($messageFactory, $options);
6565

66+
.. warning::
67+
68+
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
69+
with a body but without a ``Content-Length`` will certainly fail.
70+
To make sure all requests will be sent out correctly, we recommend to use the ``PluginClient`` with the following plugins:
71+
72+
* ``ContentLengthPlugin`` sets the correct ``Content-Length`` header, or decorate the stream to use chunked encoding
73+
* ``DecoderPlugin`` decodes encoding coming from the response (chunked, gzip, deflate and compress)
74+
* ``HeaderDefaultsPlugin`` sets default headers values if not present (like for the ``Host`` header)
75+
76+
:doc:`Read more on plugins </plugins/introduction>`
77+
6678
.. include:: includes/further-reading-sync.inc

spelling_word_list.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ auth
33
backtrace
44
boolean
55
callables
6+
chunked
67
cURL
78
Diactoros
89
fallback

0 commit comments

Comments
 (0)