我連接到API的狂飲:狂飲 - 訪問代碼在服務器上的錯誤
$client = new Client();
try {
$res = $client->post('xxx' . $this->url , [
'headers' => $headers,
'json' => $data,
]);
} catch(Exception $e) {
echo json_decode($e->getResponse()->getBody(), true);
}
,它的工作,但是當它的「抓」,我需要得到響應代碼,但我越來越:
Server error: `POST XXXXX` resulted in a `555 Error` response: {"status":"ERROR","errors":[{"message":"Subscribers already exists in this subscribers list","code":1304}]}
而我無法獲得代碼。這個怎麼做?
你說的是異常代碼嗎?或者HTTP返回狀態碼? –
@AlexHowansky HTTP。這個代碼 - >'''「code」:1304''' – Vertisan
你將不得不看看服務器上運行的任何軟件的文檔 – Jaime