File tree 1 file changed +5
-5
lines changed 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
70
70
* @param $method
71
71
* @param $uri
72
72
* @param array $headers
73
- * @param string|array|resource|StreamInterface| null $body
73
+ * @param string|null $body
74
74
* @param string $protocolVersion
75
75
* @return ResponseInterface
76
- * @throws \Http\Client\Exception
76
+ * @throws NetworkException|RequestException
77
77
*/
78
78
public function request (
79
79
$ method ,
@@ -86,9 +86,9 @@ public function request(
86
86
->createRequest ($ method , $ uri )
87
87
->withProtocolVersion ($ protocolVersion );
88
88
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 );
92
92
}
93
93
94
94
foreach ($ headers as $ name => $ value ) {
You can’t perform that action at this time.
0 commit comments