File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -70,10 +70,10 @@ private function getStreamFactory() : StreamFactoryInterface
7070 * @param $method
7171 * @param $uri
7272 * @param array $headers
73- * @param string|array|resource|StreamInterface| null $body
73+ * @param string|null $body
7474 * @param string $protocolVersion
7575 * @return ResponseInterface
76- * @throws \Http\Client\Exception
76+ * @throws NetworkException|RequestException
7777 */
7878 public function request (
7979 $ method ,
@@ -86,9 +86,9 @@ public function request(
8686 ->createRequest ($ method , $ uri )
8787 ->withProtocolVersion ($ protocolVersion );
8888
89- if ($ body ) {
90- $ stream = $ this ->getStreamFactory ()->createStream ($ body );
91- $ request = $ request ->withBody ($ stream );
89+ if ($ body !== null && $ body !== '' && is_string ( $ body ) ) {
90+ $ body = $ this ->getStreamFactory ()->createStream ($ body );
91+ $ request = $ request ->withBody ($ body );
9292 }
9393
9494 foreach ($ headers as $ name => $ value ) {
You can’t perform that action at this time.
0 commit comments