-
Notifications
You must be signed in to change notification settings - Fork 0
The Web Standard Library
C272 edited this page Aug 30, 2019
·
2 revisions
Contains all web-related client and server functionality.
Performs a GET request to the given URL. Returns an object, of the following format:
{
status: 200 //http status code
status_desc: "OK" //string, description of the status
content: "..." //The returned content, as a string.
}
Parameters:
Name | Description |
---|---|
url | The URL to perform a GET request to. |
Usage:
let x = web.get("http://example.com");
if (x.status == 200)
{
print "Successful GET request!";
print "Returned content - " + x.content + ".";
}
Performs a POST request to the given URL, given an object to post. Returns an object, of the following format:
{
status: 200 //http status code
status_desc: "OK" //string, description of the status
content: "..." //The returned content, as a string.
}
Parameters:
Name | Description |
---|---|
url | The URL to perform a GET request to. |
content | The object to POST, which is converted to JSON. |
Usage:
let x = web.post("http://example.com", object {});
Algo (c) Larry Tang, 2019.
Commercial use of Algo must include the LICENSE
file in the same directory as the executable.
Standard Library Documentation: