【发布时间】:2017-09-24 07:31:46
【问题描述】:
$client = new Client();
$url = 'api-url';
$request = $client->post($url, [
'headers' => ['Content-Type' => 'application/json'],
'json' => ['token' => 'foo']
]);
return $request;
然后我返回 502 Bad Gateway 并将资源解释为 Document 但使用 MIME 类型 application/json 传输
我需要使用一些 json 发出 POST 请求。我如何在 Laravel 中使用 Guzzle 做到这一点?
【问题讨论】: