From 355a48866d1a43df9443a3b559c8ec8642343f3a Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 5 Nov 2019 10:18:51 +0100 Subject: documentation: change JS docs template Use another template for the JS api documentation which provides a better overview over the classes and methods. Signed-off-by: Jo-Philipp Wich --- documentation/jsapi/LuCI.Request.html | 2958 +++++++++++++++++++++------------ 1 file changed, 1916 insertions(+), 1042 deletions(-) (limited to 'documentation/jsapi/LuCI.Request.html') diff --git a/documentation/jsapi/LuCI.Request.html b/documentation/jsapi/LuCI.Request.html index 2028b406fc..530bf9a033 100644 --- a/documentation/jsapi/LuCI.Request.html +++ b/documentation/jsapi/LuCI.Request.html @@ -1,203 +1,1242 @@ - + - JSDoc: Class: Request - - - + Class: Request + + + + + - - + + + + + + + + - -
- -

Class: Request

- +
+ +
+

Class: Request

+
- +
+

+ LuCI. -

- LuCI.Request

- -

The Request class allows initiating HTTP requests and provides utilities + Request + + +

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

- -
+
+ + +
+
+

+ + new LuCI.Request() +

+ + +
+ luci.js, line 569 +
+ +
+ +
+
+ + - - - - - - - - - - - - - + + + + + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + - - - - - - - - - - - - - - - - + + + + + + + +
- - - + + + + +

Classes

- +
poll
- - - - - +

Methods

- +
- +
+
+

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

+ +
+ luci.js, line 844 +
+ +
-

addInterceptor(interceptorFn) → {LuCI.Request.interceptorFn}

+
+
- - - - -
-

Register an HTTP response interceptor function. Interceptor +

+

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.

-
- - - - - - - - +
+ -
Parameters:
+ + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
NameTypeDescription
NameTypeDescription
interceptorFn @@ -206,319 +1245,289 @@ implementing request retries before returning a failure.

The interceptor function to register.

+ +

The interceptor function to register.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

The registered function.

-
- - - -
-
- Type -
-
- -LuCI.Request.interceptorFn - - -
+ +
- - - - - - - + -

expandURL(url) → {string}

- - - - -
-

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

-
- - - - - - - - - -
Parameters:
+ +
Returns:
+ + - - - - - - - - - - - - - - - - - - - + -
NameTypeDescription
url - -string - - - + LuCI.Request.interceptorFn + +

The URL to convert.

The registered function.
+ + + +
+ + + +
+
+

+ + expandURL(url){string} +

+ + +
+ luci.js, line 586 +
+ +
+ +
+
+ + +
+

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

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

The URL to convert.

+ + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

The absolute URL derived from the given one, or the original URL -if it already was absolute.

-
- - - -
-
- Type -
-
- -string - - -
+ +
- - - - - - - + -

get(target, optionsopt) → {Promise.<LuCI.Response>}

- - - - -
-

Initiate an HTTP GET request to the given target.

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

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

+ - +
+ luci.js, line 797 +
+
- Description - - + +
+
+ + +
+

Initiate an HTTP GET request to the given target.

+
+ - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + +
NameTypeDescription
target @@ -527,29 +1536,26 @@ if it already was absolute.

- - - - - -

The URL to request.

+ + + + + + +

The URL to request.

options @@ -558,169 +1564,150 @@ if it already was absolute.

- - <optional>
- - - - - -

Additional options to configure the request.

+ + + optional + + + + + +

Additional options to configure the request.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

The resulting HTTP response.

-
- - - -
-
- Type -
-
- -Promise.<LuCI.Response> - - -
+ +
- - - - - - - + -

post(target, dataopt, optionsopt) → {Promise.<LuCI.Response>}

- - - - -
-

Initiate an HTTP POST request to the given target.

-
- - - - - - - - - -
Parameters:
+ +
Returns:
+ + - - - + + + + + + + + + + + + +
NameTypeDescription
+ + Promise.<LuCI.Response> + + + The resulting HTTP response.
+ + + + +
- Attributes + +
+
+

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

+ - +
+ luci.js, line 818 +
+
- Description - - + +
+
+ + +
+

Initiate an HTTP POST request to the given target.

+
+ - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + +
NameTypeDescription
target @@ -729,29 +1716,26 @@ if it already was absolute.

- - - - - -

The URL to request.

+ + + + + + +

The URL to request.

data @@ -760,31 +1744,28 @@ if it already was absolute.

- - <optional>
- - - - - -

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

+ + + optional + + + + + +

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

options @@ -793,330 +1774,297 @@ if it already was absolute.

- - <optional>
- - - - - -

Additional options to configure the request.

+ + + optional + + + + + +

Additional options to configure the request.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

The resulting HTTP response.

-
- - - -
-
- Type -
-
- -Promise.<LuCI.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.

-
- - - - - - - - - -
Parameters:
+ + +
Returns:
+ - - - - - - - - - - - - - - - - - - - + -
NameTypeDescription
interceptorFn - -LuCI.Request.interceptorFn - - - + Promise.<LuCI.Response> + +

The interceptor function to remove.

The resulting HTTP response.
- - - - - -
- - - - - - - - - - - +
+ + +
+
+

+ + removeInterceptor(interceptorFn){boolean} +

+ +
+ luci.js, line 863 +
+ +
- +
+
- - +
+

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

+
-
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- -
-

Returns true if any function has been removed, else false.

-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
interceptorFn + + +LuCI.Request.interceptorFn -
-
- Type -
-
+ +
+ +

The interceptor function to remove.

+ + + +
+ -boolean - + + + - + + + + + + + + + + + + + + +
- - - - - - - + -

request(target, optionsopt) → {Promise.<LuCI.Response>}

- - - - -
-

Initiate an HTTP request to the given target.

-
- - - - - - - - - -
Parameters:
+ + +
Returns:
+ - - - + + + + + + + + + + + + +
NameTypeDescription
+ + boolean + + + Returns true if any function has been removed, else false.
+ + + + + - Attributes + +
+
+

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

+ - +
+ luci.js, line 648 +
+
- Description - - + +
+
+ + +
+

Initiate an HTTP request to the given target.

+
+ - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + +
NameTypeDescription
target @@ -1125,29 +2073,26 @@ function.

- - - - - -

The URL to request.

+ + + + + + +

The URL to request.

options @@ -1156,174 +2101,157 @@ function.

- - <optional>
- - - - - -

Additional options to configure the request.

+ + + optional + + + + + +

Additional options to configure the request.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- - -
-

The resulting HTTP response.

-
- - - -
-
- Type -
-
+ + + -Promise.<LuCI.Response> - - - - - + + + + + + + + + + + + +
TypeDescription
+ + Promise.<LuCI.Response> + + + The resulting HTTP response.
- - - - - + + +
+
+ +

Type Definitions

- +
- +
+
+

+ + LuCI.Request.interceptorFn(res) +

+ +
+ luci.js, line 822 +
+ +
-

interceptorFn(res)

+
+
- - - - -
-

Interceptor functions are invoked whenever an HTTP reply is received, in the order +

+

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

-
- - - - - - - - +
+ -
Parameters:
+ + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - + + + +
NameTypeDescription
NameTypeDescription
res @@ -1332,138 +2260,107 @@ these functions have been registered.

The HTTP response object

+ +

The HTTP response object

+ + - - - - - - - -
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + - - - - - - - - - - - - - - - - + + + + + + + +
-

RequestOptions

- - - - - - -
Type:
-
    -
  • - -Object - - -
  • -
- - - - - -
Properties:
- +
+
+

LuCI.Request.RequestOptionsObject

+
+ + +
+
+ + + +
- - - - - - - - - - - - - - - +
Properties:
+
-
- - - - - - +
NameTypeAttributesDefaultDescription
+ + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - - - + + + - + - + - + - + - - - + + + - + - + - + - + - - - + + + - + - + - + - + - - - + + + - + - + - + - + - - - + + + - + - + - + - + - - - + + + - + - + - + - + - - - + + + - + - + - + - + - - - + + + - + - + - + - + - - - + + + - + - + - + - + - + + + +
NameTypeArgumentDefaultDescription
method @@ -1472,17 +2369,17 @@ these functions have been registered.

<optional>
- +
@@ -1490,17 +2387,17 @@ these functions have been registered.

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

query @@ -1509,34 +2406,34 @@ these functions have been registered.

<optional>
- +

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

cache @@ -1545,17 +2442,17 @@ given object will be converted to JSON.

<optional>
- +
@@ -1563,17 +2460,17 @@ given object will be converted to JSON.

Specifies whether the HTTP response may be retrieved from cache.

username @@ -1582,33 +2479,33 @@ given object will be converted to JSON.

<optional>
- +

Provides a username for HTTP basic authentication.

password @@ -1617,33 +2514,33 @@ given object will be converted to JSON.

<optional>
- +

Provides a password for HTTP basic authentication.

timeout @@ -1652,33 +2549,33 @@ given object will be converted to JSON.

<optional>
- +

Specifies the request timeout in seconds.

credentials @@ -1687,17 +2584,17 @@ given object will be converted to JSON.

<optional>
- +
@@ -1705,17 +2602,17 @@ given object will be converted to JSON.

Whether to include credentials such as cookies in the request.

content @@ -1724,37 +2621,37 @@ given object will be converted to JSON.

<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 @@ -1763,33 +2660,33 @@ cases it is converted to a string.

<optional>
- +

Specifies HTTP headers to set for the request.

progress @@ -1798,103 +2695,80 @@ cases it is converted to a string.

<optional>
- +

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

+ - - - - - - -
- + - - - - - - - - - - - -
Source:
-
- - - +
+ + +
- - - - - +
+ +
-
- - + -
- -
-
- Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time) -
+ - - +
+ Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
+
+
+ + \ No newline at end of file -- cgit v1.2.3