简体   繁体   English

如何使用带有 id 的 guzzle laravel pacakge 发送获取请求

[英]How can i send get request using guzzle laravel pacakge with id

I want to send an API request我想发送一个 API 请求

$client = new Client();
$response = $client->request('GET', 'https://eos.greymass.com/v1/history/get_transaction', [
            'id' => '18a20dbc34082451143c03ac54a2f24d06494d51e68f8fb1211ca0b63a53f37d'
        ]);

It's working in Postman and i get data properly, but don't working in Laravel project.它在 Postman 中工作,我可以正确获取数据,但在 Laravel 项目中不起作用。

try the following code as documentation尝试以下代码作为文档

<?php
$client = new Client();
$response = $client->request('GET', 'https://domain/etc', [
    'query' => ['id' => '...']
]);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM