Guzzle 请求中的路径变量

问题描述 投票:0回答:0

最诚挚的问候,我将 Guzzle 7 与 Laravel 8 一起使用,我需要传递一个路径变量,至少这是用邮递员调用它的方式,这是我的代码

$client = new \GuzzleHttp\Client();  
$response = $client->get('xxxxxxxxxxxxxx', [    'params' => ['dni' => 'xxxxxxx'],    'headers' => ['x-api-key' => 'xxxxxxxxx']   ]);
dd($response);

但好像它没有发送任何内容,如果有人知道如何执行此查询,我将非常感激

laravel postman guzzle
© www.soinside.com 2019 - 2024. All rights reserved.