class

HAR::Request

Inherits JSON::Serializable < Reference < Object

This object contains detailed info about performed request.

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

total_size = entry.request.headers_size + entry.request.body_size

Constants

FORMDATA_MIME_VALUES = {"application/x-www-form-urlencoded", "multipart/form-data"}
Log = ::Log.for(self)

Constructors

new(method : String, url : String, http_version : String, cookies : Array(HAR::Cookie) = Array(Cookie).new, headers : Array(HAR::Header) = Array(Header).new, query_string : Array(HAR::QueryString) = Array(QueryString).new, post_data : Nil | HAR::PostData = nil, headers_size : Int32 | Nil = nil, body_size : Int32 | Nil = nil, comment : Nil | String = nil)
Source
new(http_request : HTTP::Request)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

body
Source
body_size

Size of the request body (POST data payload) in bytes. NOTE: Set to -1 if the info is not available.

Source
body_size=(body_size : Int32 | Nil)

Size of the request body (POST data payload) in bytes. 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
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 request message until (and including) the double CRLF before the body. NOTE: Set to -1 if the info is not available.

Source
headers_size=(headers_size : Int32 | Nil)

Total number of bytes from the start of the HTTP request message until (and including) the double CRLF before the body. NOTE: Set to -1 if the info is not available.

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

Request HTTP Version.

Source
http_version=(http_version : String)

Request HTTP Version.

Source
method

Request method (GET, POST, ...).

Source
method=(method : String)

Request method (GET, POST, ...).

Source
post_data

Posted data info.

Source
post_data=(post_data : PostData | Nil)

Posted data info.

Source
query_string

List of query parameter objects.

Source
query_string=(query_string : Array(QueryString))

List of query parameter objects.

Source
query_string_http_params
Source
to_http_request
Source
url

Absolute URL of the request (fragments are not included).

Source
url=(url : String)

Absolute URL of the request (fragments are not included).

Source