reqopt

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCookie

func AddCookie(cookie *http.Cookie) request.RequestOption

AddCookie adds a cookie

func AddFormField

func AddFormField(key, value string) request.RequestOption

AddFormField adds a form field

func AddParam

func AddParam(key, value string) request.RequestOption

AddParam adds a query parameter

func Header(key, value string) request.RequestOption

Header adds one HTTP header

func Headers

func Headers(header http.Header) request.RequestOption

Headers sets the HTTP header

func Method

func Method(method string) request.RequestOption

Method sets the HTTP method of the request

func SetBody

func SetBody(body []byte) request.RequestOption

SetBody sets the raw request body

func SetCookies

func SetCookies(cookies []*http.Cookie) request.RequestOption

SetCookies sets the cookies

func SetFile

func SetFile(fieldname, source string) request.RequestOption

SetFile sets a file field

func SetFileBody

func SetFileBody(fieldname, filename string, body any) request.RequestOption

SetFileBody sets a file field with body

func SetForm

func SetForm(form url.Values) request.RequestOption

SetForm sets the form data

func SetFormField

func SetFormField(key, value string) request.RequestOption

SetFormField sets a form field

func SetJSON

func SetJSON(entity any) request.RequestOption

SetJSON sets the URL of the request

func SetParam

func SetParam(key, value string) request.RequestOption

SetParam sets the query parameter

func SetParams

func SetParams(params url.Values) request.RequestOption

SetParams sets the query parameters

func Trace

func Trace() request.RequestOption

Trace enables tracing for the request

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL