我使用XML API(PHP)做的在線酒店預訂project.When我在預約碼我的工作則顯示以下如何修復411長度file_get_contents和expedia XML API所需的錯誤?
"Warning: file_get_contents(https://[email protected]</email><firstName>test</firstName><lastName>smith</lastName><homePhone>8870606867</homePhone><creditCardType>CA</creditCardType><creditCardNumber>5401999999999999</creditCardNumber>....</HotelRoomReservationRequest>) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 411 Length Required"
其我的代碼
的錯誤$context = stream_context_create(
array(
'http' => array(
'method' => 'POST',
'header' => "Content-type: application/x-www-form-urlencoded",
"Accept: application/xml"
)
)
);
$url ='https://book.api.ean.com/....';
$xml = file_get_contents($url, false, $context);
這是爲了發送信用信息PLZ慈祥地給我建議什麼類型的錯誤......。
您設置流上下文選項的方式有錯誤。 – hakre 2012-02-23 12:13:25
感謝plz提前在我的代碼中提前致謝 – user1117625 2012-02-23 12:16:46
請發佈您的完整代碼。 – hakre 2012-02-23 12:22:46