Skip to content

Netwoking

Content TypeInteger Value
PlainText0
HTML1
JSON2
XML3
PDF4
JPEG5
PNG6

get_req( string, int, string, string ) string

Sends a GET request to the given URL with the respective integer code for the ContentType and optional string parameters for User-Agent and Authorization headers. Returns the response body as a string.

Example Usage:

var res = get_req("http://127.0.0.1:8000/data", 0);
print res;
// Output:
Default

post_req( string, string, int, string, string ) string

Sends a POST request to the given URL with the data to be written to it, the respective integer code for the ContentType, and optional string parameters for User-Agent and Authorization headers. Returns the response body as a string.

Example Usage:

var res = post_req("http://127.0.0.1:8000/pos_data", "new value from post", 0);
print res;
// Output:
Data updated to new value from post

put_req( string, string, int, string, string ) string

Sends a PUT request to the given URL with the data to be written to it, the respective integer code for the ContentType, and optional string parameters for User-Agent and Authorization headers. Returns the response body as a string.

Example Usage:

var res = put_req("http://127.0.0.1:8000/put_data", "new value from put", 0);
print res;
// Output:
Data updated to new value from put

delete_req( string, int, string, string ) string

Sends a DELETE request to the given URL with the respective integer code for the ContentType and optional string parameters for User-Agent and Authorization headers. Returns the response body as a string.

Example Usage:

var res = delete_req("http://127.0.0.1:8000/del_data", 0);
print res;
// Output:
Data deleted