Members
-
durationnumber
-
The total duration of the HTTP request in milliseconds
-
headersLuCI.Headers
-
The HTTP headers of the response
-
okboolean
-
Describes whether the response is successful (status codes
200..299
) or not -
statusnumber
-
The numeric HTTP status code of the response
-
statusTextstring
-
The HTTP status description message of the response
-
urlstring
-
The final URL of the request, i.e. after following redirects.
Methods
-
clone(content){LuCI.Response}
-
Clones the given response object, optionally overriding the content of the cloned instance.
Name Type 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
String()
and treated as response text.Returns:
Type Description LuCI.Response The cloned Response
instance. -
Access the response content as JSON data.
Throws:
-
Throws
SyntaxError
if the content isn't valid JSON. - Type
- SyntaxError
Returns:
Type Description * The parsed JSON data. -
-
Access the response content as string.
Returns:
Type Description string The response content.