curl请求并等待响应

时间:2014-03-23 08:38:13

标签: php curl response sessionid

我尝试通过cURL向此网站http://bookonline.saudiairlines.com发送请求,并且会话依赖于此。例如:

http://www.bookonline.saudiairlines.com/pl/SaudiAirlines/wds/Override.action;jsessionid=MnQhTnNQcd12vjV7zT5lwLvm6bJh8KbLhPB1bFQTpvxl4dTWLqQS!-2104883082!632911 .........

除了我收到中间屏幕显示:

之外,一切都进行了

请稍等....

我如何等待并获得包含航班详情的实际结果。

谢谢。

这是我的代码:

<?php
// Get cURL resource
$curl = curl_init();
// Set some options - we are passing in a useragent too here
curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL
=>
'http://www.bookonline.saudiairlines.com/pl/SaudiAirlines/wds/Override.action;jsessionid=rq42TndFnL295Lg9SzFph16pL881c9gQJVbPW7W8vGWdTPdmsDjF!-2104883082!632911924?PRICING_TYPE=C&B_DATE_1=201403230000&B_DATE_2=201403230000&B_LOCATION_1=DMM&LANGUAGE=GB&EMBEDDED_TRANSACTION=FlexPricerAvailability&WDS_E_LOCATION_1_DISPLAY=Riyadh&WDS_B_LOCATION_1_DISPLAY=Dammam&BOOKING_FLOW=REVENUE&E_LOCATION_1=RUH&WDS_TABS=online&SITE=BDXHBDXH&DISPLAY_TYPE=2&SO_SITE_OFFICE_ID=JEDSV08AA&TRIP_TYPE=O&EXTERNAL_ID=dummy&OFFICE_ID=JEDSV08AA&COMMERCIAL_FARE_FAMILY_1=CFFGUEST&COMMERCIAL_FARE_FAMILY_2=CFFBUS&COMMERCIAL_FARE_FAMILY_3=CFFFIRST&TRAVELLER_TYPE_1=ADT&calendar_0Day=23&calendar_0MonthYear=032014&CABIN=E
', CURLOPT_USERAGENT => 'Codular Sample cURL Request' ));
// Send the request & save response to $resp
$resp = curl_exec($curl); echo $resp;
// Close request to clear up some resources
curl_close($curl);
?>

0 个答案:

没有答案