Send a document as content data using Psr7 stream.

parent fb77742d
...@@ -5,6 +5,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -5,6 +5,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
## [Unreleased] ## [Unreleased]
### Added ### Added
- Documents can be sent by providing its contents via Psr7 stream (as opposed to passing a file path).
### Changed ### Changed
### Deprecated ### Deprecated
### Removed ### Removed
......
...@@ -201,7 +201,7 @@ class Request ...@@ -201,7 +201,7 @@ class Request
//Reformat data array in multipart way if it contains a resource //Reformat data array in multipart way if it contains a resource
foreach ($data as $key => $item) { foreach ($data as $key => $item) {
$has_resource |= is_resource($item); $has_resource |= (is_resource($item) || $item instanceof \GuzzleHttp\Psr7\Stream);
$multipart[] = ['name' => $key, 'contents' => $item]; $multipart[] = ['name' => $key, 'contents' => $item];
} }
if ($has_resource) { if ($has_resource) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment