2014-10-23 05:47
浏览 635


I am attempting to query the NOTAM database ( in order to have the server parse the NOTAMs for display on a map, code is PHP.

I'm using cURL to send the POST data, however, the server is returning an "invalid request". Here is the POST data I'm sending to the server. It is exactly what is sent during a request from the homepage (discovered using Fiddler). The NOTAMs needed are the "RKRR" ICAO (airport code for Incheon Center here in Korea).

What am I missing here?

$url = "";
$ch = curl_init($url);

$header = array('Host:', 'Content-Type: application/x-www-form-urlencoded',      'Connection: keep-alive', 'Cache-Control: max-age=0', 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/*;q=0.8', 'User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36', 'Referer:', 'Accept-Encoding: gzip,deflate', 'Accept-Language: en-US,en;q=0.8', 'Origin:');

$data = 'retrieveLocId=rkrr&reportType=Raw&submit=View+NOTAMSs&actionType=notamRetriealByICAOs';
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$response = curl_exec($ch);

echo $response;

Thanks for the help!

图片转代码服务由CSDN问答提供 功能建议

我正在尝试查询NOTAM数据库( )为了让服务器解析NOTAM以在地图上显示,代码是PHP。</ p> \ n

我正在使用cURL发送POST数据,但服务器返回“无效请求”。 这是我发送给服务器的POST数据。 它正是在主页请求期间发送的内容(使用Fiddler发现)。 所需的NOTAM是“RKRR”ICAO(韩国仁川中心的机场代码)。 </ p>

我在这里缺少什么?</ p>

  $ url =“  .do“; 
 $ ch = curl_init($ url); 
 $ header = array('','Content-Type:application / x-www-form-urlencoded  ','连接:保持活动','缓存控制:max-age = 0','接受:text / html,application / xhtml + xml,application / xml; q = 0.9,image / webp,/ *;  q = 0.8','User-Agent:Mozilla / 5.0(Windows NT 6.3; WOW64)AppleWebKit / 537.36(KHTML,与Gecko一样)Chrome / 37.0.2062.124 Safari / 537.36','Referer:https://www.notams。','Accept-Encoding:gzip,deflate','Accept-Language:en-US,en; q = 0.8','Origin:')  ; 
 $ data ='retrieveLocId = rkrr&amp; reportType = Raw&amp; submit = View + NOTAMSs&amp; actionType = notamRetriealByICAOs'; 
curl_setopt($ ch,CURLOPT_HTTPHEADER,$ header); 
 ncurl_setopt($ ch,CURLOPT_POST,1)  ; 
curl_setopt($ ch,CURLOPT_POSTFIELDS,$ data); 
curl_setopt($ ch,CURLOPT_RETURNTRANSFER,1); 
 $ response = curl_exec($ ch)  ; 
echo $ response; 
curl_close($ ch); 
 </ code> </ pre> 

感谢您的帮助!</ p> </ div>

1条回答 默认 最新

相关推荐 更多相似问题