http

package
v1.0.135 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

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

Functions

func ReadAll

func ReadAll(client Client) func(Requester) RIOE.ReaderIOEither[[]byte]

ReadAll sends a request and reads the response as bytes

func ReadFullResponse

func ReadFullResponse(client Client) func(Requester) RIOE.ReaderIOEither[H.FullResponse]

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

func ReadJSON added in v1.0.118

func ReadJSON[A any](client Client) func(Requester) RIOE.ReaderIOEither[A]

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

func ReadJson deprecated

func ReadJson[A any](client Client) func(Requester) RIOE.ReaderIOEither[A]

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

Deprecated: use ReadJSON instead

func ReadText

func ReadText(client Client) func(Requester) RIOE.ReaderIOEither[string]

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

Types

type Client

type Client interface {
	// Do can send an HTTP request considering a context
	Do(Requester) RIOE.ReaderIOEither[*http.Response]
}

func MakeClient

func MakeClient(httpClient *http.Client) Client

MakeClient creates an HTTP client proxy

type Requester

type Requester = RIOE.ReaderIOEither[*http.Request]

Requester is a reader that constructs a request

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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