SA-MP Forums Archive
HTTP gives me response code 1 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: HTTP gives me response code 1 (/showthread.php?tid=410651)



HTTP gives me response code 1 - pasha97 - 26.01.2013

WHy does it give response code 1(Bad host) to the http callback? I tried to paste this link to the browser and it works
pawn Код:
HTTP(playerid, HTTP_GET, "http://ultrabee.dlinkddns.com:7775/live", "", "PlayRadio");

pawn Код:
forward PlayRadio(playerid, response_code, const data[]);
public PlayRadio(playerid, response_code, const data[])
{
printf("%d",response_code);//this gives to the server console the response code(always 1)
    if(response_code == 200)
    {
        //Yes!
        PlayAudioStreamForPlayer(playerid,"http://ultrabee.dlinkddns.com:7775/live");
        SendClientMessage(playerid, COLORE_BIANCO,"{00ff00}Our radio is online! You started to listen to it!");
    }
    else
    {
        //Yes!
        SendClientMessage(playerid, COLORE_BIANCO,"{ff0000}Our radio is offline!");
    }
}



Re: HTTP gives me response code 1 - Vince - 26.01.2013

https://sampwiki.blast.hk/wiki/HTTP
HTTP_ERROR_BAD_HOST


Re: HTTP gives me response code 1 - pasha97 - 26.01.2013

Quote:
Originally Posted by Vince
Посмотреть сообщение
i know that this is "bad host", but how to fix it?


Re: HTTP gives me response code 1 - FUNExtreme - 26.01.2013

I think you're just using it wrong. What sort of information is an mp3 file supposed to be returning? Talking about the HTTP_GET