struct

MongrelDB::Response

Inherits Struct < Value < Object

Response wraps one HTTP response from the daemon. It exposes the raw status code and body and a json helper for decoding a JSON body.

Constructors

new(status : Int32, body : String = "")
Source

Instance methods

body

The raw response body (may be empty).

Source
json

Parse the response body as JSON and return the decoded value (Hash, Array, String, Int64, ...). Returns nil for an empty body. Raises QueryError if the body is not valid JSON.

Source
status

The HTTP status code.

Source
success?

True when the HTTP status is in the 2xx success range.

Source