如何检索从枪口BadResponseException(ClientException || ServerException)对象使用的form_params?
我在文档中找不到它。
try {
$reponse = $this->client->post($uri, [
'form_params' => $params,
'headers' => $this->getHeaders()
]);
} catch (RequestException $e){
/// get form_params here without accessing $params
}
表单编码参数可以在请求正文中找到。
try {
$reponse = $this->client->post($uri, [
'form_params' => $params,
'headers' => $this->getHeaders()
]);
} catch (RequestException $e){
echo (string) $e->getRequest()->getBody();
}