Skip to content

Commit d01c53c

Browse files
Merge pull request #133 from php-http/joelwurtz-patch-1
Add a warning about missing headers on the request
2 parents 0f2b962 + 4923f5c commit d01c53c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

clients/socket-client.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,15 @@ 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+
75+
:doc:`Read more on plugins </plugins/introduction>`
76+
6677
.. 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
Elasticsearch

0 commit comments

Comments
 (0)