Documentation ¶
Index ¶
- func Delete[TSender RequestSender](t testing.TB, app TSender, uri string, modifiers ...RequestModifier) *http.Response
- func Get[TSender RequestSender](t testing.TB, app TSender, uri string, modifiers ...RequestModifier) *http.Response
- func MakeRequest[T any](t testing.TB, method, uri string, modifiers ...RequestModifier) *http.Request
- func Patch[TSender RequestSender, TBody any](t testing.TB, app TSender, uri string, modifiers ...RequestModifier) *http.Response
- func Post[TSender RequestSender, TBody any](t testing.TB, app TSender, uri string, modifiers ...RequestModifier) *http.Response
- func Put[TSender RequestSender, TBody any](t testing.TB, app TSender, uri string, modifiers ...RequestModifier) *http.Response
- type RequestModifier
- type RequestSender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete[TSender RequestSender](t testing.TB, app TSender, uri string, modifiers ...RequestModifier) *http.Response
Returns a pointer to http.Response from DELETE request for testing purposes
func Get ¶
func Get[TSender RequestSender](t testing.TB, app TSender, uri string, modifiers ...RequestModifier) *http.Response
Returns a pointer to http.Response from GET request for testing purposes
func MakeRequest ¶
func MakeRequest[T any](t testing.TB, method, uri string, modifiers ...RequestModifier) *http.Request
Provides a way to create a request for testing purposes
func Patch ¶
func Patch[TSender RequestSender, TBody any](t testing.TB, app TSender, uri string, modifiers ...RequestModifier) *http.Response
Returns a pointer to http.Response from PATCH request for testing purposes
func Post ¶
func Post[TSender RequestSender, TBody any](t testing.TB, app TSender, uri string, modifiers ...RequestModifier) *http.Response
Returns a pointer to http.Response from POST request for testing purposes
func Put ¶
func Put[TSender RequestSender, TBody any](t testing.TB, app TSender, uri string, modifiers ...RequestModifier) *http.Response
Returns a pointer to http.Response from PUT request for testing purposes
Types ¶
type RequestModifier ¶
type RequestModifier Delegates http.Request functions
func WithBody ¶
func WithBody[T any](t testing.TB, body T) RequestModifier
Provides a way to set Body of a request for testing purposes
func WithCookies ¶
func WithCookies(t testing.TB, cookies []*http.Cookie) RequestModifier
Provides a way to set Cookies of a request for testing purposes Example:
cookies := []*http.Cookie{ {Name: "jwt-token"}, }
WithCookies(t, cookies)
func WithHeaders ¶
func WithHeaders(t testing.TB, headers http.Header) RequestModifier
Provides a way to set Headers of a request for testing purposes