When using a self-signed certificate, guzzle uses a multipart stream, which...

When using a self-signed certificate, guzzle uses a multipart stream, which doesn't allow arrays, so they need to be encoded to JSON first.
[skip ci]
parent 417d280c
...@@ -183,6 +183,7 @@ class Request ...@@ -183,6 +183,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);
is_array($item) && $item = json_encode($item);
$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