JSON POST请求 - JSON数据,如何在具有代理请求的跨服务器上使用JSON格式的数据执行发布请求

I am using the following API call using json format but i am not getting output in any format. what i want to know is how i can set up the proxy code with javacript , so that i can get data from cross server(another server). Is there any other possibility to receive/display data from a foreign domain ? iFrames follow the same policy? here is my api url: api.wego.com/flights/api/k/2/searches?api_key=your_secret_api_key&ts_code=your_secret_ts_code

and i want to pass this below parameter: { "trips": [ { "departure_code": "SIN", "arrival_code": "HKG", "outbound_date": "2013-10-14", "inbound_date": "2013-10-21" } ], "adults_count": 1 }

and i was using this below code:

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_URL, 'http://api.wego.com/flights/api/k/2/searches?api_key=xxxxxxxxx&ts_code=xxxxx');
curl_setopt($ch, CURLOPT_HTTPHEADER,array('Content-Type: application/json','Accept: application/json'));

$data = 
"trips": [
    {
      "departure_code": "SIN",
      "arrival_code": "HKG",
      "outbound_date": "2013-10-14",
      "inbound_date": "2013-10-21"
    }
  ],
  "adults_count": 1;

curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
$result=curl_exec($ch);
var_dump($result); 

Thanks

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_URL, 'http://api.wego.com/flights/api/k
      /2/searches?api_key=xxxxxxxxx&ts_code=xxxxx');
curl_setopt($ch, CURLOPT_HTTPHEADER,array('Content-Type'=>'application/json',
        'Accept'=> 'application/json'));

$data ='{"trips":
     [ { "departure_code": "SIN", "arrival_code": "HKG",
           "outbound_date": "2013-10-14", "inbound_date": "2013-10-21" } ]
     , "adults_count": 1}';

curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$result=curl_exec($ch);
var_dump($result);