class

HAR::Content

Inherits JSON::Serializable < Reference < Object

This object describes details about response content (embedded in Response object).

NOTE: Before setting the text field, the HTTP response is decoded (decompressed & unchunked), than trans-coded from its original character set into UTF-8. Additionally, it can be encoded using e.g. base64. Ideally, the application should be able to unencode a base64 blob and get a byte-for-byte identical resource to what the browser operated on.

NOTE: Encoding field is useful for including binary responses (e.g. images) into the HAR file.

Constructors

new(size : Int32 | Nil = nil, compression : Int32 | Nil = nil, mime_type : Nil | String = nil, text : Nil | String = nil, encoding : Nil | String = nil, comment : Nil | String = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

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
compression

Number of bytes saved.

Source
compression=(compression : Int32 | Nil)

Number of bytes saved.

Source
encoding

Encoding used for response text field e.g base64. Leave out this field if the text field is HTTP decoded (decompressed & unchunked), than trans-coded from its original character set into UTF-8.

Source
encoding=(encoding : String | Nil)

Encoding used for response text field e.g base64. Leave out this field if the text field is HTTP decoded (decompressed & unchunked), than trans-coded from its original character set into UTF-8.

Source
mime_type

MIME type of the response text (value of the Content-Type response header). The charset attribute of the MIME type is included (if available).

Source
mime_type=(mime_type : String | Nil)

MIME type of the response text (value of the Content-Type response header). The charset attribute of the MIME type is included (if available).

Source
size

Length of the returned content in bytes. Should be equal to response.body_size if there is no compression and bigger when the content has been compressed.

Source
size=(size : Int32 | Nil)

Length of the returned content in bytes. Should be equal to response.body_size if there is no compression and bigger when the content has been compressed.

Source
text

Response body sent from the server or loaded from the browser cache. This field is populated with textual content only. The text field is either HTTP decoded text or a encoded (e.g. base64) representation of the response body.

Source
text=(text : String | Nil)

Response body sent from the server or loaded from the browser cache. This field is populated with textual content only. The text field is either HTTP decoded text or a encoded (e.g. base64) representation of the response body.

Source