PDA

View Full Version : HTTP_GET throws Bad_Host Error


BiosMarcel
06/12/2015, 10:41 AM
Hey,

I am trying to do a simple Request but it seems like i can't even connect to the server, i have already tried it with a local server and with a non local server, it just won't work.
I already tried deactivating my firewall but that's also useless, anyways that shouldn't be necessary since i tried it on localhost and the file permissions are also correct.
Does anyone know what the problem could be?
I guess u don't need any code here but still here:

HTTP(1,HTTP_GET, "ftp://user1@127.0.0.1/nope.txt", "", "MyHttpResponse");

greetings Marcel

Calgon
06/12/2015, 11:13 AM
The clue is in the name - the function is called HTTP, not FTP...

BiosMarcel
06/12/2015, 11:18 AM
i also tried it with http ^^

HTTP(1,HTTP_GET, "http://noscams.bplaced.net/nope.html", "", "MyHttpResponse");

but that didnt work so i tried it directly per ftp

Calgon
06/12/2015, 11:25 AM
Take a look at how it's used: http://wiki.sa-mp.com/wiki/HTTP

url[] The URL you want to request. (Without 'http://')

BiosMarcel
06/12/2015, 11:28 AM
if you mean that i try it with a .html file i also tried that with .txt and the "playerid" is just a number u can user any number, so if u know the mistake , tell me cuz i can't see it :|

BiosMarcel
06/12/2015, 11:30 AM
never mind, now i got it, it was the "http://"

thanks man