且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将查询字符串参数添加到Guzzle GET请求中?

更新时间:2023-02-25 16:54:52

我有同样的问题.我找到了解决办法

I have the same problem. I found solution

public static function getGroupList($current=false) {
$response = self::getRestClient()->get(
    [
        'domains/{domainId}/pricelists',
        ['domainId' => self::getDomainId()]
    ],
    [
        'query' => [
        current => $current
        ]
    ]
);

return new RestResponse($response);

尝试

$response = $client->get(
        [
            $config->Layout['server'],
            []
        ],
        [
            'query' => [
                $config->Layout['switches'], // ([ '-db' => 'database', '-lay' => 'layout', '-find' => true)
                $config->Layout['options'], // other params
            ]
        ]
);