HttpDouble.Request (http_double v1.0.0)

Copy Markdown View Source

Representation of a parsed HTTP/1.1 request.

This struct is used internally by the server, mock engine and matchers, and is exposed in typespecs so that callback functions in tests can inspect it.

Summary

Types

Canonical method name as an uppercase string (e.g. "GET").

Decoded query string key/value map.

t()

Parsed HTTP request.

Types

method()

@type method() :: String.t()

Canonical method name as an uppercase string (e.g. "GET").

query()

@type query() :: %{optional(String.t()) => String.t()}

Decoded query string key/value map.

t()

@type t() :: %HttpDouble.Request{
  body: binary(),
  conn_id: non_neg_integer() | nil,
  headers: [{String.t(), String.t()}],
  host: String.t() | nil,
  http_version: String.t(),
  method: method(),
  path: String.t(),
  port: non_neg_integer() | nil,
  query: query(),
  raw_path: String.t(),
  request_index: non_neg_integer()
}

Parsed HTTP request.

headers is a list of {name, value} tuples with lowercase header names.