Commit db940cc0 authored by Armando Lüscher's avatar Armando Lüscher Committed by GitHub

Merge pull request #375 from noplanman/fix_request_params

Fix Telegram request parameters
parents c9f4785e 4045700c
......@@ -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