Skip to content

Request

A request the mock server received.

Returned by Mock.received and Server.received_requests, and passed to a match: or respond: callback.

Fields

body @ Bin

The raw request body.

headers @ Dict[Str, Str | time.DateTime]

The request headers.

Example
server.mock
  - match: do |req|
      req.headers["x-trace"] == "abc"
    respond:
      status: 200
method @ Str

The request method, such as "GET".

url @ Str

The full request URL.