Due to the way that Telegram interprets the request URL, http_build_query that...

Due to the way that Telegram interprets the request URL, http_build_query that Guzzle uses doesn't work properly. Instead, we now convert all arrays to JSON encoded strings, which get interpreted correctly!
parent 299fde41
......@@ -180,10 +180,14 @@ class Request
$has_resource = false;
$multipart = [];
// Convert any nested arrays into JSON strings.
array_walk($data, function (&$item) {
is_array($item) && $item = json_encode($item);
});
//Reformat data array in multipart way if it contains a resource
foreach ($data as $key => $item) {
$has_resource |= is_resource($item);
is_array($item) && $item = json_encode($item);
$multipart[] = ['name' => $key, 'contents' => $item];
}
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