[Ayuda] Problemas con HTTP_GET
#1

Hola, buenas noches, hoy intentaba obtener informaciуn del sitio web, pero me salta el siguiente error (respose_code): "HTTP_ERROR_MALFORMED_RESPONSE"

He buscado por todos los foros de SA-MP entre otros pero no he conseguir encontrar la soluciуn... Si me pueden ayudar estarнa muy agradecido.

Este es mi cуdigo:

Код:
#include <a_samp>
#include <a_http>
#include <core>

new Lugar[255];
//new Tiempo;
new timertiempo;

forward actualizartiempo();
forward TiempoWeb(index, response_code, data[]);

public OnFilterScriptInit()
{
    print("===== Tiempo Real =====");
    print("Actualizando... Puede tardar... ");
    Lugar = "Madrid";
    printf("=====> Tiempo Real =====> Lugar establecido a: %s", Lugar);
    printf("=====> Tiempo Real =====> Descargando tiempo...", Lugar);
    HTTP(1, HTTP_GET, "midominio.com/realtime/tiempo.php?lugar=Madrid", "", "TiempoWeb");

    //timertiempo = SetTimer("actualizartiempo", 1000, true); // Set a timer of 1000 miliseconds (1 second)
}

public OnFilterScriptExit()
{
    KillTimer(timertiempo);
}

public actualizartiempo()
{
    //print("1 second has passed.");
}

public TiempoWeb(index, response_code, data[])
{

    if(response_code == 200)
    {
        printf("The URL replied: %s", data);
    }
    else
    {
         printf("The request failed! The response code was: %d", response_code);
    }
}
Y tengo otra duda, їla pбgina que se debe cargar debe ser un .txt o puede ser .php y otros?
Reply


Messages In This Thread
[Ayuda] Problemas con HTTP_GET - by Hircine - 20.08.2012, 23:27
Respuesta: [Ayuda] Problemas con HTTP_GET - by TheChaoz - 21.08.2012, 02:36
Respuesta: [Solucionado] Problemas con HTTP_GET - by Hircine - 21.08.2012, 08:50

Forum Jump:


Users browsing this thread: 1 Guest(s)