Members
duration :number
The total duration of the HTTP request in milliseconds
Type:
- number
headers :LuCI.Headers
The HTTP headers of the response
Type:
ok :boolean
Describes whether the response is successful (status codes 200..299
) or not
Type:
- boolean
status :number
The numeric HTTP status code of the response
Type:
- number
statusText :string
The HTTP status description message of the response
Type:
- string
url :string
The final URL of the request, i.e. after following redirects.
Type:
- string
Methods
clone(contentopt) → {LuCI.Response}
Clones the given response object, optionally overriding the content of the cloned instance.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
content |
* |
<optional> |
Override the content of the cloned response. Object values will be
treated as JSON response data, all other types will be converted
using |
Returns:
The cloned Response
instance.
- Type
- LuCI.Response
json() → {*}
Access the response content as JSON data.
Throws:
-
Throws
SyntaxError
if the content isn't valid JSON. - Type
- SyntaxError
Returns:
The parsed JSON data.
- Type
- *
text() → {string}
Access the response content as string.
Returns:
The response content.
- Type
- string