HTTP data to global?
#1

So i try get HTTP respond data to global variable... But i get (null)

pawn Код:
// My Code
// Top Of script
new info[56];
public OnGameModeInit() {
        HTTP(0, HTTP_GET, "webpage.address", "", "MyHttpResponse"); // webpage.address is not right address...
        print(info);
        return 1;
    }
forward MyHttpResponse(index, response_code, data[]);
public MyHttpResponse(index, response_code, data[])
{
    new
        buffer[ 128 ];
    if(response_code == 200) //Did the request succeed?
    {
        format(buffer, sizeof(buffer), "The URL replied: %s", data);
        format(info, sizeof(info), "%s", data);
        print(buffer);
    }
    else
    {
        print("Error getting feedback from server.");
    }
}
Any clue why it won't show data in info?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)