#1

Well hello peoples, i made out this script to just try it and put it on my gamemode
pawn Код:
CMD:test(playerid, params[])
{
    HTTP(playerid, HTTP_GET, "sagamerz.comli.com/test/sss.txt", "", "MyHttpResponse");
    return 1;
}
forward MyHttpResponse(index, response_code, data[]);
public MyHttpResponse(index, response_code, data[])
{
    // In this callback "index" would normally be called "playerid" ( if you didn't get it already :) )
    new
        buffer[ 128 ];
    if(response_code == 200) //Did the request succeed?
    {
        //Yes!
        format(buffer, sizeof(buffer), "The URL replied: %s", data);
        SendClientMessage(index, 0xFFFFFFFF, buffer);
    }
    else
    {
        //No!
        format(buffer, sizeof(buffer), "The request failed! The response code was: %d", response_code);
        SendClientMessage(index, 0xFFFFFFFF, buffer);
    }
}
But when i try the cmd, i get error code 6 or aka. HTTP_ERROR_MALFORMED_RESPONSE 6

I dont know how it comes, its only in-game, not in pawno, it dosnt tell me anything compiles fine. But ingame is the problem
Reply


Messages In This Thread
http - by CrazyChoco - 25.09.2012, 11:02
Re: http - by Vince - 25.09.2012, 11:08
Re: http - by CrazyChoco - 25.09.2012, 11:08
Re: http - by Vince - 25.09.2012, 11:11
Re: http - by CrazyChoco - 25.09.2012, 11:17
Re: http - by CrazyChoco - 25.09.2012, 11:52
Re: http - by CrazyChoco - 25.09.2012, 14:47

Forum Jump:


Users browsing this thread: 1 Guest(s)