requests

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: MIT Imports: 6 Imported by: 1

README

Request helper

Helpers to make it easier for me to write requests

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(url string, payload io.Reader) *http.Request

func Do

func Do(client *http.Client, request *http.Request) (*http.Response, error)

func DoAndHandleResponse

func DoAndHandleResponse[T any](client *http.Client, request *http.Request, handler func(response *http.Response, err error) T) T

func DoAndReadByte

func DoAndReadByte(client *http.Client, request *http.Request) ([]byte, *http.Response, error)

func DoAndReadString

func DoAndReadString(client *http.Client, request *http.Request) (string, *http.Response, error)

func Get

func Get(url string) *http.Request

func ParseProxy

func ParseProxy(proxyUrl string) (*url.URL, error)

func Patch

func Patch(url string, payload io.Reader) *http.Request

func Post

func Post(url string, payload io.Reader) *http.Request

func Put

func Put(url string, payload io.Reader) *http.Request

func ReadResponseBody

func ReadResponseBody(response *http.Response) ([]byte, error)

func SetHeaders

func SetHeaders(request *http.Request, headerMaps ...map[string]string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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