class HAR::Content

Overview

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.

Included Modules

Defined in:

har/content.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.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) #

[View source]

Instance Method Detail

def comment : String | Nil #

A comment provided by the user or the application.


[View source]
def comment=(comment : String | Nil) #

A comment provided by the user or the application.


[View source]
def compression : Int32 | Nil #

Number of bytes saved.


[View source]
def compression=(compression : Int32 | Nil) #

Number of bytes saved.


[View source]
def 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.


[View source]
def 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.


[View source]
def mime_type : String | Nil #

[View source]
def mime_type=(mime_type : String | Nil) #

[View source]
def 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.


[View source]
def 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.


[View source]
def 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.


[View source]
def 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.


[View source]