HTTP Request Extension
This extension package provides networking functionality or ajax magic (I had to use that buzzword at least once in this documentation
Functions
Basic - Syncronized
http_get(url,async) - Sends a http get request to the server. url is the link you want to send the request to. async should be false. This will return the response. If the response is an error, an empty string will be returned, "".
http_post(url,params,async) - Sends a http post request to the server. url is the link you want to send the request to. params is the data you want to send, for example, "score=5&name=Bob". async should be false. This will return the response. If the response is an error, an empty string will be returned, "".
Advanced - Asyncronized
http_get(url,async) - Sends a http get request to the server. url is the link you want to send the request to. async should be true. This will return the handle of the request. This will be used to check when the request is ready or if it has can error.
http_post(url,params,async) - Sends a http post request to the server. url is the link you want to send the request to. params is the data you want to send, for example, "score=5&name=Bob". async should be true. This will return the handle of the request. This will be used to check when the request is ready or if it has can error.
http_check_ready(handle) - This will likely go in the step event, it checks where a request is ready. handle is the handle of the request. This will return true when ready, otherwise false will be returned.
http_check_error(handle) - This checks if the response was an error such as 404 page not found. handle is the handle of the request. This will return true if an error did occur, otherwise false will be returned. Only call this function once you know that the request is ready.
http_retrieve(handle) - Once you know that the request is ready, you can use this function to return the response of the request. If there was an error, the error code will be returned. If there wasn't an error, the response will be returned. handle is the handle of the request. AFTER USING THIS, SET THE HANDLE TO FALSE AS SHOW IN THE EXAMPLE BELOW.
Live Example
http://syntaxgames.c...r/http_request/
Links
http://syntaxgames.c...t_Extension.zip (direct)
http://www.crocko.co...t_Extension.zip (mirror)
Online Documentation
http://syntaxgames.c...umentation.html
Compatibility
I have slightly tested it on IE, Firefox, Opera and Chrome which it all seems to work on. I don't have a mobile device, so I wasn't able to test it on one.
License
Feel free to use and abuse as you wish. Credit appreciated though.











