gpt4 book ai didi

php - 如何使用 file_get_contents 和 expedia XML API 修复 411 Length Required 错误?

转载 作者:可可西里 更新时间:2023-11-01 16:50:37 34 4
gpt4 key购买 nike

<分区>

我正在使用 xml api(php) 项目进行在线酒店预订。当我在预订代码中工作时,它显示以下错误

"Warning: file_get_contents(https://...@gmail.com</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);

这是为了发送信用信息请给我建议是什么类型的错误...。

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com