我希望在发送之前看到post请求数据包,因为req中存在错误,而api是一般描述500 错误所以我无法告诉y请求失败的地方。我知道xml格式错误,因为它适用于chrome的postman。
$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
]);
这个请求适用于邮递员的chrome,这是一个xml
的工作示例changePassPhraseRequestXML=<ChangePassPhraseRequest><RequesterID>lxxx</RequesterID><RequestID>1263055835</RequestID><CertifiedIntermediary><AccountID>lxxx</AccountID><PassPhrase>dfdsfsd</PassPhrase></CertifiedIntermediary><NewPassPhrase>fdsfdsfds</NewPassPhrase></ChangePassPhraseRequest>