The Spectator scripting engines provides some common and some new built-in functions. This documentation lists the built-ins and the API.
getHTTP.get makes a GET-request.
Arguments:
url : String - Destination of the request
Returns:
response : Response
postHTTP.post makes a POST-request.
Arguments:
url : String - Destination of the request headers : Object - Header List
Returns:
response : Response
putHTTP.put makes a PUT-request.
Arguments:
url : String - Destination of the request headers : Object - Header List
Returns:
response : Response
patchHTTP.patch makes a PATCH-request.
Arguments:
url : String - Destination of the request headers : Object - Header List
Returns:
response : Response
destroyHTTP.destroy makes a DESTROY-request.
Arguments:
url : String - Destination of the request headers : Object - Header List
Returns:
response : Response
headHTTP.head makes a HEAD-request.
Arguments:
url : String - Destination of the request headers : Object - Header List
Returns:
response : Response
logconsole.log writes a string to the console.
Arguments:
args : Any[] - Accepts an array of arguments of any type and logs each argument to the console
Returns:
Nothing returned
warningconsole.warning writes a warning-string to the console.
Arguments:
args : Any[] - Accepts an array of arguments of any type and logs each argument to the console
Returns:
Nothing returned
errorconsole.error writes a error-string to the console.
Arguments:
args : Any[] - Accepts an array of arguments of any type and logs each argument to the console
Returns:
Nothing returned
UrlEncodedUrl encodes multiple key-value pairs.
Arguments:
entries : Object - A flat object of key-value pairs.
Returns:
encoded : UrlEncoded
FormDataTransforms multiple key-value pairs to a FormData object.
Arguments:
entries : Object - A flat object of key-value pairs.
Returns:
formData : FormData