Pronounced
/ˈɹɛkən/
, like "reckon".
Reqn is an HTTP request library for Skript 2.X.
Submits an HTTP request to the given URL. This
send [a[n]] [http] [%method%] [web] request to [the] [url] %url% [with ([the] header[s] %headers% [and [the] body %body%]|[the] body %body% [and [the] header[s] %headers%])]
The last part of the syntax simply allows the header and body to be written in either order
(e.g. with the headers and the body
or with the body and the headers
)
method
(typetext
) - The HTTP method to use to send the request. If omitted, defaults to"get"
.url
(typetext
) - The URL to send the request to.headers
(typetexts
) - One or more headers in the format"Header-Name: Value"
to be sent in the request header.body
(typetexts
) - Additional data to be sent in the body of the request. Multiple texts are joined with new lines. This cannot be sent if the request uses the"get"
method.
Returns a custom httpresponse
object that contains information from the last completed http
request.
[the] [last[ly]] [received] [http] [web] response
Returns the status codes of one or more httpresponses
.
[the] [response] [status] code[s] of %httpresponses%
or
%httpresponses%'[s] [response] [status] code[s]
Returns the status messages of one or more httpresponses
.
[the] [response] [status] (message|reason)[s] of %httpresponses%
or
%httpresponses%'[s] [response] [status] (message|reason)[s]
Returns the status lines of one or more httpresponses
.
[the] [response] status[(es| line[s])] of %httpresponses%
or
%httpresponses%'[s] [response] status[(es| line[s])]
Returns the headers of one or more httpresponses
in the format "Header-Name: Value"
.
Multiple httpresponses
may be passed to this expression, but the resulting headers will be
combined into a single list with no way to associate each header with its original httpresponse
.
[the] [response] header[s] of %httpresponses%
or
%httpresponses%'[s] [response] header[s]
Returns the header keys (names) of one or more httpresponses
. This expression is best used in
conjunction with Response Header Values
Multiple httpresponses
may be passed to this expression, but the resulting keys will be
combined into a single list with no way to associate each key with its original httpresponse
.
[the] [response] header key[s] of %httpresponses%
or
%httpresponses%'[s] [response] header key[s]
Returns the header values of one or more httpresponses
. This expression is best used in
conjunction with Response Header Keys
Multiple httpresponses
may be passed to this expression, but the resulting values will be
combined into a single list with no way to associate each value with its original httpresponse
.
[the] [response] header value[s] of %httpresponses%
or
%httpresponses%'[s] [response] header value[s]
Returns the values of a specific header for one or more httpresponses
.
Multiple httpresponses
may be passed to this expression, but the resulting values will be
combined into a single list with no way to associate each value with its original httpresponse
.
[the] %header% [response] header[ value][s] of %httpresponses%
or
%httpresponses%'[s] %header% [response] header[ value][s]
header
(typetext
) - The name of the header to return.
Returns the bodies of one or more httpresponses
.
[the] [response] bod(y|ies) of %httpresponses%
or
%httpresponses%'[s] [response] bod(y|ies)
Converts a text into a text safe for usage in URLs. This can be useful for injecting user input into a URL (e.g. when using a search api).
(http|ur(i|l)) (safe|encoded|escaped) %input%
input
(typetexts
) - One or more input texts to encode.
Converts a text into a text safe for usage in JSON strings. This can be useful for injecting user input into a JSON payload (e.g. when using a search api).
json (safe|encoded|escaped) %input%
input
(typetexts
) - One or more input texts to encode.
Feel free to submit pull requests, just make sure your changes are consistent with Google's Java code style!