Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Request ¶
type Request struct {
Method string
Path string
Want func(t *testing.T, r *http.Request)
Status int
JSON any
JSONRaw string
}
Request describes a http request that a [httptest.Server] should receive, and the corresponding response to return.
Additional checks on the request (e.g. request body) may be added using the [Request.Want] function.
The response body is populated from either a JSON struct, or a JSON string.
Click to show internal directories.
Click to hide internal directories.