[英]How to use Hub API using Curl in php
I have purchase Hub API from RouteHappy website for search flights using Source and Destination. 我已经从RouteHappy网站购买了Hub API,用于使用“来源”和“目的地”进行搜索航班。
They give me below code for using their API 他们给我下面使用API的代码
curl \
-H "Auth: YOUR_API_KEY" \
-H "Accept: application/vnd.api.v3+json" \
-G \
-d ids=DSM-ORD-AA-3558-20160907-FIRST \
-d include=seat,wifi \
YOUR_HOST/segments
But I am not able to use Flight API using Curl in PHP, Laravel.Please help me out to access API and get desire result. 但是我无法使用PHP,Laravel中的Curl使用Flight API。请帮助我访问API并获得期望的结果。
the equivalent using hhb_curl would be 使用hhb_curl的等效项是
echo (new hhb_curl ( '', true ))->setopt_array ( array (
CURLOPT_URL => 'YOUR_HOST/segments',
CURLOPT_HTTPHEADER => array (
"Auth: YOUR_API_KEY",
"Accept: application/vnd.api.v3+json"
),
CURLOPT_POSTFIELDS => http_build_query ( array (
'ids' => 'DSM-ORD-AA-3558-20160907-FIRST',
'include' => 'seat,wifi'
) )
) )->exec ()->getStdOut ();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.