#6

I also tried with this code:
pawn Код:
#include <a_http>
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/test", cmdtext, true, 10) == 0)
    {
        HTTP(playerid, HTTP_GET, "sagamerz.comli.com/test/sss.txt", "", "MyHttpResponse");

        return 1;
    }
    return 0;
}

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);
    }
}
I still get the same response code. Any ideas why?
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)