FakeHTTP v0.3.2 FakeHTTP.Request View Source

This module represents a HTTP request.

Request properties:

  • host - the requested host as a binary, example: "www.example.com"
  • method - HTTP method as an atom (:get, :head, :post, :put, :delete, etc.)
  • scheme - the request scheme as an atom, example: :http
  • port - the requested port as an integer, example: 80
  • request_path - the requested path, example: /path/to/index.html
  • headers - the request headers as a map
  • body - the request body
  • query_string - the request query string as a binary, example: "foo=bar"

Link to this section Summary

Link to this section Types

Link to this type

headers() View Source
headers() :: %{required(binary()) => binary()}

Link to this type

method() View Source
method() :: :get | :post | :put | :patch | :delete | :options | :head

Link to this type

t() View Source
t() :: %FakeHTTP.Request{
  body: body(),
  headers: headers(),
  host: binary(),
  method: method(),
  port: integer(),
  query_string: binary() | nil,
  request_path: binary(),
  scheme: scheme()
}