0
我希望看到發送請求數據包之前,我發送它作爲req中有一個錯誤和api是一般性描述500 錯誤,所以我不能告訴y請求失敗。我知道xml的格式不正確,因爲它在Chrome上運行在postman上。查看guzzle發帖請求
$client = new GuzzleHttp\Client([
'base_uri' => 'https://elstestserver.endicia.com',
]);
$xml = 'changePassPhraseRequestXML=<ChangePassPhraseRequest> <RequesterID>lxxx</RequesterID><RequestID>1263055835</RequestID><CertifiedIntermediary><AccountID>lxxx</AccountID><PassPhrase>dfdsfsd</PassPhrase></CertifiedIntermediary><NewPassPhrase>fdfdsfdsfs</NewPassPhrase></ChangePassPhraseRequest>';
$data = array("ChangePassPhraseXML" => $xml);
$response = $client->post("/LabelService/EwsLabelService.asmx/ChangePassPhraseXML", [
'form_params' => $data
]);
申請工作在郵遞員鉻的繼承人的XML的工作示例
changePassPhraseRequestXML=<ChangePassPhraseRequest><RequesterID>lxxx</RequesterID><RequestID>1263055835</RequestID><CertifiedIntermediary><AccountID>lxxx</AccountID><PassPhrase>dfdsfsd</PassPhrase></CertifiedIntermediary><NewPassPhrase>fdsfdsfds</NewPassPhrase></ChangePassPhraseRequest>
你會尋找調試請求選項。如果在客戶端實例化中將其設置爲true,則客戶端發出的所有請求都會將請求輸出到php:// stdout。供參考:http://guzzle.readthedocs.org/en/latest/request-options.html#debug –