laravel / lumen-framework

The Laravel Lumen Framework.
https://lumen.laravel.com
MIT License
1.48k stars 416 forks source link

Get method does not send data properly. #1193

Closed MohammadZarifiyan closed 3 years ago

MohammadZarifiyan commented 3 years ago

Description:

Get parameters is sent like this: param1=value1 ; param2=value2 ; .... instead of this: param1=value1 & param2=value2 & ....

Steps To Reproduce:

use Illuminate\Support\Facades\Http;
Http::get('http://example.com', ['param1'=>'value1', 'param2'=>'value2',....]);

I solved that by using urlencode():

$data = ['param1'=>'value1', 'param2'=>'value2',....];
$data = urlencode($data);
Http::get('http://example.com', $data);

but still has problem, because nested arrays does not receive properly by the endpoint server. for example:

Http::get('http://api.telegram.org/bot[API_TOKEN]/sendMessage',[
                'chat_id' => 123456789,
                'text' => 'Hello there',
                'reply_markup' => [
                    'keyboard' => [
                        [['text' => 'Some random button title']]
                    ]
                ],
            ]);

Telegram cannot process reply_markup, so does not show a keyboard to user. But, when I use CURL to send above data to telegram (using GET method), it works properly.