From 89a50c2f8f45a4d5a1bfbc2eb8e29e5836feeccb Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 2 Apr 2020 21:50:07 +0200 Subject: docs: update js api docs Signed-off-by: Jo-Philipp Wich --- docs/jsapi/LuCI.request.html | 3443 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 3443 insertions(+) create mode 100644 docs/jsapi/LuCI.request.html (limited to 'docs/jsapi/LuCI.request.html') diff --git a/docs/jsapi/LuCI.request.html b/docs/jsapi/LuCI.request.html new file mode 100644 index 0000000000..a505568cb0 --- /dev/null +++ b/docs/jsapi/LuCI.request.html @@ -0,0 +1,3443 @@ + + + + + Class: request + + + + + + + + + + + + + + + + + +
+ + +
+

Class: request

+ + + + +
+ +
+

+ LuCI. + + request +

+ +

The Request class allows initiating HTTP requests and provides utilities +for dealing with responses.

+ +
+ +
+
+ + + + +
+
+

+ + new LuCI.request() +

+ + + + +
+ + +
+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + +
+ + + + + + + + +

Classes

+ +
+
poll
+
+
+ + + + + + + +

Methods

+ +
+ +
+
+

+ + addInterceptor(interceptorFn){LuCI.request.interceptorFn} +

+ + + + +
+ + +
+
+ + +
+

Register an HTTP response interceptor function. Interceptor +functions are useful to perform default actions on incoming HTTP +responses, such as checking for expired authentication or for +implementing request retries before returning a failure.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
interceptorFn + + +LuCI.request.interceptorFn + + + + + +

The interceptor function to register.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + LuCI.request.interceptorFn + + + The registered function.
+ + + + +
+ + + +
+
+

+ + expandURL(url){string} +

+ + + + +
+ + +
+
+ + +
+

Turn the given relative URL into an absolute URL if necessary.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
url + + +string + + + + + +

The URL to convert.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + string + + + The absolute URL derived from the given one, or the original URL +if it already was absolute.
+ + + + +
+ + + +
+
+

+ + get(target, options){Promise.<LuCI.response>} +

+ + + + +
+ + +
+
+ + +
+

Initiate an HTTP GET request to the given target.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
target + + +string + + + + + + + + + + +

The URL to request.

options + + +LuCI.request.RequestOptions + + + + + + + optional + + + + + +

Additional options to configure the request.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + Promise.<LuCI.response> + + + The resulting HTTP response.
+ + + + +
+ + + +
+
+

+ + post(target, data, options){Promise.<LuCI.response>} +

+ + + + +
+ + +
+
+ + +
+

Initiate an HTTP POST request to the given target.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
target + + +string + + + + + + + + + + +

The URL to request.

data + + +* + + + + + + + optional + + + + + +

The request data to send, see LuCI.request.RequestOptions for details.

options + + +LuCI.request.RequestOptions + + + + + + + optional + + + + + +

Additional options to configure the request.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + Promise.<LuCI.response> + + + The resulting HTTP response.
+ + + + +
+ + + +
+
+

+ + removeInterceptor(interceptorFn){boolean} +

+ + + + +
+ + +
+
+ + +
+

Remove an HTTP response interceptor function. The passed function +value must be the very same value that was used to register the +function.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
interceptorFn + + +LuCI.request.interceptorFn + + + + + +

The interceptor function to remove.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + boolean + + + Returns true if any function has been removed, else false.
+ + + + +
+ + + +
+
+

+ + request(target, options){Promise.<LuCI.response>} +

+ + + + +
+ + +
+
+ + +
+

Initiate an HTTP request to the given target.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
target + + +string + + + + + + + + + + +

The URL to request.

options + + +LuCI.request.RequestOptions + + + + + + + optional + + + + + +

Additional options to configure the request.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + Promise.<LuCI.response> + + + The resulting HTTP response.
+ + + + +
+ +
+ + + +

Type Definitions

+ +
+ +
+
+

+ + LuCI.request.interceptorFn(res) +

+ + + + +
+ + +
+
+ + +
+

Interceptor functions are invoked whenever an HTTP reply is received, in the order +these functions have been registered.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
res + + +LuCI.response + + + + + +

The HTTP response object

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

LuCI.request.RequestOptionsObject

+
+ + +
+
+ + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDefaultDescription
method + + +string + + + + + + <optional>
+ + + +
+ + GET + +

The HTTP method to use, e.g. GET or POST.

query + + +Object.<string, (Object|string)> + + + + + + <optional>
+ + + +
+ +

Query string data to append to the URL. Non-string values of the +given object will be converted to JSON.

cache + + +boolean + + + + + + <optional>
+ + + +
+ + false + +

Specifies whether the HTTP response may be retrieved from cache.

username + + +string + + + + + + <optional>
+ + + +
+ +

Provides a username for HTTP basic authentication.

password + + +string + + + + + + <optional>
+ + + +
+ +

Provides a password for HTTP basic authentication.

timeout + + +number + + + + + + <optional>
+ + + +
+ +

Specifies the request timeout in seconds.

credentials + + +boolean + + + + + + <optional>
+ + + +
+ + false + +

Whether to include credentials such as cookies in the request.

responseType + + +string + + + + + + <optional>
+ + + +
+ + text + +

Overrides the request response type. Valid values or text to +interpret the response as UTF-8 string or blob to handle the +response as binary Blob data.

content + + +* + + + + + + <optional>
+ + + +
+ +

Specifies the HTTP message body to send along with the request. +If the value is a function, it is invoked and the return value +used as content, if it is a FormData instance, it is used as-is, +if it is an object, it will be converted to JSON, in all other +cases it is converted to a string.

header + + +Object.<string, string> + + + + + + <optional>
+ + + +
+ +

Specifies HTTP headers to set for the request.

progress + + +function + + + + + + <optional>
+ + + +
+ +

An optional request callback function which receives ProgressEvent +instances as sole argument during the HTTP request transfer.

+ + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + +
+ +
+ + + + + + + +
+ Documentation generated by JSDoc 3.6.3 on Thu Apr 02 2020 21:30:57 GMT+0200 (Central European Summer Time) +
+
+
+ + + + \ No newline at end of file -- cgit v1.2.3