13.07.2012, 09:00
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:
whereas this will work just fine (stuntplanet.ugngames.net/ is a live server)
index.php
It just seems strange to me?
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
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"
PHP код:
<?="OK"?>