PHP语言,使用Guzzle HTTP 客户端为什么一直报 require POST method?
发布于 7 年前 作者 juan54 11372 次浏览 来自 问答
$token = $this->miniApp->create()->access_token->getToken(true);
$client = $this->clientFactory->create();
$res = $client->post('http://api.weixin.qq.com/wxa/servicemarket?access_token=' . $token['access_token'], [
    RequestOptions::JSON => [
        'service' => 'wxee446d7507c68b11',
        'api' => 'imgSecCheck',
        'client_msg_id' => 'client_msg_id_1',
        'data' => [
            'Action' => 'ImageModeration',
            'Scenes' => ["PORN", "POLITICS", "TERRORISM"],
            "ImageUrl" => $url,
            'ImageBase64' => '',
            'Config' => '',
            'Extra' => ''
        ]
    ]
]);

返回 : {"errcode":43002,"errmsg":"require POST method"}
回到顶部