php - Unable to get actual html in JSON result when accessing import.io API via cURL -


when access import api manually in browser copying api-url proper json result html fields have html results. however, when access same api url via curl php in following json result: {"name":"my_html","type":"html"} ..so without actual html.

i use following function curl api in php:

public function queryio($connectorguid,$url,$input,$userguid,$apikey) {      $io_url = "https://api.import.io/store/data/".$connectorguid."/_query?input/webpage/url=".urlencode($url)."&_user=" . urlencode($userguid) . "&_apikey=".$apikey;      $ch = curl_init();     $timeout = 5;     curl_setopt($ch,curlopt_url,$io_url);     curl_setopt($ch,curlopt_returntransfer,1);     curl_setopt($ch,curlopt_connecttimeout,$timeout);     $data = curl_exec($ch);     curl_close($ch);      return $data; } 

my question how can actual html? btw, works fine other fields text, date/time, etc.

try removing

curl_setopt($ch,curlopt_connecttimeout,$timeout); 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -