24.01.2012, 17:08
So i try get HTTP respond data to global variable... But i get (null)
Any clue why it won't show data in info?
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.");
}
}