class Akita::HarLogger::HarEntry

Encapsulates an HTTP request-response pair.

Attributes

request[R]
response[R]

Public Class Methods

new(start_time, wait_time_ms, env, status, headers, body) click to toggle source

Params:

start_time

a Time object representing the request's start time.

env

the request's HTTP environment.

status

the response's HTTP status code.

headers

the response's HTTP headers.

body

the response's HTTP body.

# File lib/akita/har_logger/har_entry.rb, line 18
def initialize(start_time, wait_time_ms, env, status, headers, body)
  @self = {
    startedDateTime: start_time.strftime('%FT%T.%L%:z'),
    time: wait_time_ms,
    request: (HttpRequest.new env),
    response: (HttpResponse.new env, status, headers, body),
    cache: {},  # Not applicable to server-side logging.
    timings: {
      send: 0,  # Mandatory, but not applicable to server-side logging.
      wait: wait_time_ms,
      receive: 0,  # Mandatory, but not applicable to server-side logging.
    },
  }
end

Public Instance Methods

to_json(*args) click to toggle source
# File lib/akita/har_logger/har_entry.rb, line 33
def to_json(*args)
  @self.to_json(*args)
end