Module: scripts/request_handler

This file handles all HTTP Requests to the Server.
Source:

Classes

RequestHandler

Methods

(async, inner) GET(endpoint, args, callback)

Sends an HTTP GET request to the server.
Parameters:
Name Type Description
endpoint string The endpoint you wish to speak to.
args Array.<string> The arguments to add to the URL.
callback function The callback to call after execution.
Source:

(async, inner) POST(endpoint, args, body, callback)

Sends an HTTP POST request to the server with a body.
Parameters:
Name Type Description
endpoint string The endpoint you wish to speak to.
args Array.<string> The arguments to add to the URL.
body object Either JSON data or a file input to send data.
callback function The callback to call after execution.
Source:

(inner) constructEndpoint(endpoint, args) → {string}

Constructs the URL using the endpoint and URL arguments.
Parameters:
Name Type Description
endpoint string The endpoint you wish to speak to.
args Array.<string> The arguments to add to the URL.
Source:
Returns:
The constructed URL.
Type
string

(inner) getCookieValue(name) → {string}

Retrieves a certain cookie value from the local storage.
Parameters:
Name Type Description
name string The name of the variable to look for.
Source:
Returns:
The value of the certain cookie.
Type
string

(inner) setCookie(name, value)

Set a cookie in the local storage.
Parameters:
Name Type Description
name string The name of the cookie to set.
value string The value of the cookie.
Source:

(inner) setTheme(pageHandler, changeTheme)

Sets the theme in the local storage and updates the page.
Parameters:
Name Type Description
pageHandler PageHandler The handler for UI updates.
changeTheme boolean Whether to change the theme or not.
Source: