http

package
v1.0.65 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MakeRequest is an eitherized version of [http.NewRequest]
	MakeRequest = IOE.Eitherize3(http.NewRequest)

	// specialize
	MakeGetRequest = makeRequest("GET", nil)
)

Functions

func ReadAll

func ReadAll(client Client) func(Requester) IOE.IOEither[error, []byte]

ReadAll sends a request and reads the response as bytes

func ReadFullResponse added in v1.0.58

func ReadFullResponse(client Client) func(Requester) IOE.IOEither[error, H.FullResponse]

ReadFullResponse sends a request, reads the response as a byte array and represents the result as a tuple

func ReadJson

func ReadJson[A any](client Client) func(Requester) IOE.IOEither[error, A]

ReadJson sends a request, reads the response and parses the response as JSON

func ReadText

func ReadText(client Client) func(Requester) IOE.IOEither[error, string]

ReadText sends a request, reads the response and represents the response as a text string

Types

type Client

type Client interface {
	Do(Requester) IOE.IOEither[error, *http.Response]
}

func MakeClient

func MakeClient(httpClient *http.Client) Client

type Requester added in v1.0.58

type Requester = IOE.IOEither[error, *http.Request]

Requester is a reader that constructs a request

Jump to

Keyboard shortcuts

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