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 [get]

The raw request body.

headers @ Map[Str, Str | time.DateTime] [get]

The request headers.

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

The request method, such as "GET".

url @ Str [get]

The full request URL.