true, // return web page CURLOPT_HEADER => false, // don't return headers CURLOPT_FOLLOWLOCATION => true, // follow redirects CURLOPT_MAXREDIRS => 10, // stop after 10 redirects CURLOPT_ENCODING => "", // handle compressed CURLOPT_USERAGENT => "test", // name of client CURLOPT_AUTOREFERER => true, // set referrer on redirect CURLOPT_CONNECTTIMEOUT => 120, // time-out on connect CURLOPT_TIMEOUT => 120, // time-out on response ); $token = "5514145896-2356-52659-1234"; $fields = array( "token" => $token, "folio" => "5921" //Folio ejemplo ); $fields_string = http_build_query($fields); $ch = curl_init("https://huespedmanager.com/hospy/api/getbookuser.php"); curl_setopt_array($ch, $options); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Authorization:token $token" )); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string ); $response = curl_exec($ch); curl_close($ch); $resArrFind = array(); $resArrFind = json_decode($response); $new_array_find = objectToArray($resArrFind); echo json_encode($new_array_find); exit; ?>