class HAR::Content
- HAR::Content
- Reference
- Object
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
- JSON::Serializable
Defined in:
har/content.crConstructors
- .new(pull : JSON::PullParser)
- .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)
Instance Method Summary
-
#comment : String | Nil
A comment provided by the user or the application.
-
#comment=(comment : String | Nil)
A comment provided by the user or the application.
-
#compression : Int32 | Nil
Number of bytes saved.
-
#compression=(compression : Int32 | Nil)
Number of bytes saved.
-
#encoding : String | Nil
Encoding used for response text field e.g
base64
. -
#encoding=(encoding : String | Nil)
Encoding used for response text field e.g
base64
. - #mime_type : String | Nil
- #mime_type=(mime_type : String | Nil)
-
#size : Int32 | Nil
Length of the returned content in bytes.
-
#size=(size : Int32 | Nil)
Length of the returned content in bytes.
-
#text : String | Nil
Response body sent from the server or loaded from the browser cache.
-
#text=(text : String | Nil)
Response body sent from the server or loaded from the browser cache.
Constructor Detail
Instance Method Detail
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.
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.
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.
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.
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.
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.