From 20a70f21ed2d8c1f4a6042f9878115af137a63e0 Mon Sep 17 00:00:00 2001 From: Vladimir Andronov Date: Thu, 30 Sep 2021 15:42:16 +0300 Subject: [PATCH] fix \Loco\Http\Request\BodyLocation --- src/Http/Request/BodyLocation.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Http/Request/BodyLocation.php b/src/Http/Request/BodyLocation.php index a8ae9ce..077b917 100644 --- a/src/Http/Request/BodyLocation.php +++ b/src/Http/Request/BodyLocation.php @@ -43,13 +43,11 @@ public function visit( if ('' !== $value) { throw new \RuntimeException('Only one "body" location may exist per operation'); } - + // binary string data from bound parameter $value = $command[$param->getName()]; $request = $request->withHeader('Content-Type', 'application/octet-stream'); - // TODO Replace deprecated function with Psr7\Utils::streamFor - // https://github.com/loco/loco-php-sdk/issues/12 - return $request->withBody(Psr7\stream_for($value)); + return $request->withBody(Psr7\Utils::streamFor($value)); } }