class

HAR::Response

Inherits JSON::Serializable < Reference < Object

This object contains detailed info about the response.

The total response size received can be computed as follows (if both values are available):

total_size = entry.response.headers_size + entry.response.body_size

Constructors

new(http_response : HTTP::Client::Response)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

body
Source
body_size

Size of the received response body in bytes. Set to 0 in case of responses coming from the cache (304). NOTE: Set to -1 if the info is not available.

Source
body_size=(body_size : Int32 | Nil)

Size of the received response body in bytes. Set to 0 in case of responses coming from the cache (304). NOTE: Set to -1 if the info is not available.

Source
comment

A comment provided by the user or the application.

Source
comment=(comment : String | Nil)

A comment provided by the user or the application.

Source
content

Details about the response body.

Source
content=(content : Content)

Details about the response body.

Source
content_type
Source
headers

List of header objects.

Source
headers=(headers : Array(Header))

List of header objects.

Source
headers_size

Total number of bytes from the start of the HTTP response message until (and including) the double CRLF before the body.

NOTE: Set to -1 if the info is not available. NOTE: The size of received response-headers is computed only from headers that are really received from the server. Additional headers appended by the browser are not included in this number, but they appear in the list of header objects.

Source
headers_size=(headers_size : Int32 | Nil)

Total number of bytes from the start of the HTTP response message until (and including) the double CRLF before the body.

NOTE: Set to -1 if the info is not available. NOTE: The size of received response-headers is computed only from headers that are really received from the server. Additional headers appended by the browser are not included in this number, but they appear in the list of header objects.

Source
http_cookies
Source
http_cookies=(http_cookies : HTTP::Cookies)
Source
http_headers
Source
http_headers=(http_headers : HTTP::Headers)
Source
http_version

Response HTTP Version.

Source
http_version=(http_version : String)

Response HTTP Version.

Source
mime_type
Source
redirect_url

Redirection target URL from the Location response header.

Source
redirect_url=(redirect_url : String | Nil)

Redirection target URL from the Location response header.

Source
status

Response status code.

Source
status=(status : Int32)

Response status code.

Source
status_text

Response status description.

Source
status_text=(status_text : String)

Response status description.

Source
to_http_response
Source