File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,8 @@ public function read(): Response
5959 try {
6060 $ resource = $ this ->createResource (\stream_context_create (['http ' => $ this ->options ]));
6161 if ($ this ->hasError ($ resource )) {
62- return $ this ->getPhpError (HttpStatus::FAILED_DEPENDENCY );
62+ return $ this ->getPhpError (HttpStatus::FAILED_DEPENDENCY ,
63+ 'The HTTP client is not created therefore cannot read anything ' );
6364 }
6465 return new ServerResponse (
6566 \stream_get_contents ($ resource ),
@@ -118,13 +119,16 @@ public function verifySslPeer(bool $value): HttpRequestClient
118119 }
119120
120121 /**
122+ * NOTE: if Content-Type is not provided
123+ * fopen() will assume application/x-www-form-urlencoded
124+ *
121125 * @param resource $context from stream_context_create()
122126 *
123127 * @return resource|bool
124128 */
125129 protected function createResource ($ context )
126130 {
127- return \fopen ((string )$ this ->getUri (), 'rb ' , false , $ context );
131+ return @ \fopen ((string )$ this ->getUri (), 'rb ' , false , $ context );
128132 }
129133
130134 protected function prepareRequestBody (): void
You can’t perform that action at this time.
0 commit comments