post请求,请求接口报错:resulted in a `400 Bad Request` response
原代码:
$this->guzzleService->post( $url, [
'headers' => [
'Content-Type' => 'application/json;charset=utf-8'
],
'form_params' => $data
]);
将form_params改为json就可以了:
$this->guzzleService->post( $url, [
'headers' => [
'Content-Type' => 'application/json;charset=utf-8'
],
'json' => $data
]);