HTTP IssueRequest

Issue a http request with the given info.
Only handles json data, any table sent over post is converted to json so you need to prase it on there.
The server must also set the reply's content-type to "application/json" and have the responce be in json :)
;Usage
HTTP.IssueRequest(url, method, PostData, Callback) = success
Parameter	Type 	Description
URL 	string 	What address to issue the request to
method 	string 	Is it a Get or Post message
PostData 	table 	If this is a post request then this is the data to send to the server. The table is converted to json and then sent to the server.
Callback 	function	What function to call when the request is completed
;Return Values
Value 	Type 	Description
Result	boolean	Was the request sent?
;Examples:
<nowiki>
function getTweet()
 local url = "https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=Red5Studios&count=1";
 
 if not HTTP.IsRequestPending() then -- Only one http request at a time is allowed so check if one is already pending
 HTTP.IssueRequest(url, "get", nil, CB_getTweet);
 end
end
function CB_getTweet(args, err)
 if (err) then
 warn(tostring(err));
 else
 -- args is the data in table form, have fun with it
 end
end
</nowiki>
Category:Addon_API