Closed MohammadZarifiyan closed 3 years ago
Get parameters is sent like this: param1=value1 ; param2=value2 ; .... instead of this: param1=value1 & param2=value2 & ....
use Illuminate\Support\Facades\Http; Http::get('http://example.com', ['param1'=>'value1', 'param2'=>'value2',....]);
I solved that by using urlencode():
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.
Description:
Get parameters is sent like this: param1=value1 ; param2=value2 ; .... instead of this: param1=value1 & param2=value2 & ....
Steps To Reproduce:
I solved that by using
urlencode()
:but still has problem, because nested arrays does not receive properly by the endpoint server. for example:
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.