Documentation ¶
Overview ¶
Package roundtripper contains http.RoundTripper implementations suitable for testing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONRoundTripper ¶
type JSONRoundTripper struct { // Handler is called by RoundTrip with the unmarshalled JSON from an *http.Request. // Returns an HTTP status code and an any to marshal as JSON in an *http.Response. Handler func(any) (int, any) // Type is the reflect.Type to unmarshal *http.Request.Body into. // Defaults to map[string]string{}. Type reflect.Type }
JSONRoundTripper implements http.RoundTripper to handle *http.Requests with a JSON body.
Click to show internal directories.
Click to hide internal directories.