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, "nombre_reserva" => "ADMOND", "num_apto" => "ADMON", "cantidad_h" => "2", "tipo_ocu" => "HUESPED", "instancia_d" => "5", "fecha_ing" => "2025-07-07", "hora_ing" => "00:00:01", "fecha_sal" => "2025-07-08", "hora_sal" => "00:02:00", "parqueadero" => "UHB01E", "observaciones" => "SN", "sesion" => "AGENCIA HOSPY" ); $fields_string = http_build_query($fields); $ch = curl_init("https://huespedmanager.com/hospy/api/reserva.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; ?>