我正面临获得卷曲响应的问题
测试.xml
<?xml version="1.0" encoding="UTF-8"?>
<MMTHotelSearchRequest Offset="0" Rows="500">
<POS>
<Requestor type="B2BAgent" idContext="AFF" id="AFF13856" channel="B2BWeb"/>
<Source iSOCurrency="INR"/>
</POS>
<RequestHotelParams>
<CityCode>DEL,XRO</CityCode>
</RequestHotelParams>
<RequiredFields>hotelInfo,facilitiesInfo,areaInfo,contactInfo,roomsInfo,mediaInfo</RequiredFields>
</MMTHotelSearchRequest>
<?php
$filename = "test.xml";
$handle = fopen($filename, "r");
$xml = fread($handle, filesize($filename));
fclose($handle);
$url = "https://apim-gateway.mmtcloud.com/mmt-htlsearch/1.0/staticsearch/v1.0/hotelData";
$headers = array(
"Content-type: text/xml;charset=\"utf-8\"",
"Accept: text/xml",
"Cache-Control: no-cache",
"Pragma: no-cache",
"Content-length: ".strlen($xml),
);
$soap_do = curl_init();
curl_setopt($soap_do, CURLOPT_URL, $url);
curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($soap_do, CURLOPT_TIMEOUT, 60);
curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true );
curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($soap_do, CURLOPT_POST, true );
curl_setopt($soap_do, CURLOPT_POSTFIELDS, $xml);
curl_setopt($soap_do, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($soap_do);
print_r($result);
?>
我得到以下错误
HTTP 状态 415 -
类型状态报告
信息
描述 服务器拒绝此请求,因为请求实体的格式不受请求的方法 () 的请求资源支持。
请帮我。