05.12.2012, 01:39
Vejo muita gente usando agora.. Existe algum tutorial bem explicado sobre ela? fiquei curioso quanto a suas funзхes.
CMD:ler(playerid)
{
HTTP(playerid, HTTP_GET, "site.com/arquivo.txt", "", "MyHttpResponse");
return 1;
}
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), "Dados recebidos: %s", data);
printf("%s",buffer);
}
else
{
//No!
format(buffer, sizeof(buffer), "The request failed! The response code was: %d", response_code);
printf("%s",buffer);
}
}