Class: HttpArchive::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/http_archive/classes.rb

Overview

Holds information about the performed request in an interaction

Instance Attribute Summary collapse

Instance Attribute Details

#body_sizeFixnum

Size of the request body (POST data payload)

Returns:

  • (Fixnum)

    body size of this request in bytes, -1 if not available


103
104
105
# File 'lib/http_archive/classes.rb', line 103

def body_size
  @body_size
end

#cookiesArray

A list of cookie objects for this request

Returns:

  • (Array)

    list of cookie objects as an array


89
90
91
# File 'lib/http_archive/classes.rb', line 89

def cookies
  @cookies
end

#headersHash

The headers of this request

Examples:

{"Host"=>"...", "User-Agent"=>"...", "Accept"=>"...", "Accept-Language"=>"...", "Accept-Encoding"=>"...", "Connection"=>"..."}

Returns:

  • (Hash)

    header objects (strings) as a hash


97
98
99
# File 'lib/http_archive/classes.rb', line 97

def headers
  @headers
end

#headers_sizeFixnum

Size of the request header

Returns:

  • (Fixnum)

    header size of this request in bytes, -1 if not available


100
101
102
# File 'lib/http_archive/classes.rb', line 100

def headers_size
  @headers_size
end

#http_methodString

The method of this request

Returns:

  • (String)

    request method as string, e.g. “GET”


80
81
82
# File 'lib/http_archive/classes.rb', line 80

def http_method
  @http_method
end

#http_versionString

The HTTP version of this request

Returns:

  • (String)

    HTTP version as string, e.g. “HTTP/1.1”


86
87
88
# File 'lib/http_archive/classes.rb', line 86

def http_version
  @http_version
end

#query_stringArray

A list of query parameters for this request

Returns:

  • (Array)

    list of query parameters as an array


92
93
94
# File 'lib/http_archive/classes.rb', line 92

def query_string
  @query_string
end

#urlString

The absolute url of the request

Returns:


83
84
85
# File 'lib/http_archive/classes.rb', line 83

def url
  @url
end