Why doesn't HTTP work for local servers?
#1

This actually took me a while to figure out, since i coulden't find any proper HTTP documentation apart from the one on the sa-mp wiki. Why does HTTP not work when u try to send requests to a local server?

Example, this will not work and will always return status code 6:

pawn Код:
#define SERVER "127.0.0.1/index.php" // let's assume index.php exists and returns "OK"
HTTP(playerid, HTTP_GET, SERVER, "", "HTTPResponse");

// Will return status code 6
// Data: nothing
whereas this will work just fine (stuntplanet.ugngames.net/ is a live server)

pawn Код:
#define SERVER "www.stuntplanet.ugngames.net/index.php" // let's assume index.php exists and returns "OK"
HTTP(playerid, HTTP_GET, SERVER, "", "HTTPResponse");

// Will return status code 200
// Data: "OK"
index.php
PHP код:
<?="OK"?>
It just seems strange to me?
Reply


Messages In This Thread
Why doesn't HTTP work for local servers? - by Sinner - 13.07.2012, 09:00
Re: Why doesn't HTTP work for local servers? - by Vince - 13.07.2012, 09:26
Re: Why doesn't HTTP work for local servers? - by Sinner - 13.07.2012, 09:54

Forum Jump:


Users browsing this thread: 2 Guest(s)