Members
duration :number
The total duration of the HTTP request in milliseconds
- number
headers :LuCI.headers
The HTTP headers of the response
ok :boolean
Describes whether the response is successful (status codes 200..299) or not
- boolean
status :number
The numeric HTTP status code of the response
- number
statusText :string
The HTTP status description message of the response
- string
url :string
The final URL of the request, i.e. after following redirects.
- string
Methods
blob() → {Blob}
Access the response content as blob.
The response content as blob.
- Type:
- Blob
clone(contentopt) → {LuCI.response}
Clones the given response object, optionally overriding the content of the cloned instance.
| 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 |
The cloned Response instance.
- Type:
- LuCI.
response
json() → {*}
Access the response content as JSON data.
Throws
SyntaxErrorif the content isn't valid JSON.- Type
- SyntaxError
The parsed JSON data.
- Type:
- *
text() → {string}
Access the response content as string.
The response content.
- Type:
- string