http

package
v2.13.3 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 12 Imported by: 3 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

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

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

Functions

This section is empty.

Types

type Client

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

func MakeClient

func MakeClient(httpClient *http.Client) Client

type Kleisli

type Kleisli[E, A, B any] = ioeither.Kleisli[E, A, B]

func MakeBodyRequest

func MakeBodyRequest(method string, body ioeither.IOEither[error, []byte]) Kleisli[error, string, *http.Request]

MakeBodyRequest creates a request that carries a body

func ReadAll

func ReadAll(client Client) Kleisli[error, Requester, []byte]

ReadAll sends a request and reads the response as bytes

func ReadFullResponse

func ReadFullResponse(client Client) Kleisli[error, Requester, 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) Kleisli[error, Requester, A]

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

func ReadJson deprecated

func ReadJson[A any](client Client) Kleisli[error, Requester, A]

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

Deprecated: use ReadJSON instead

func ReadText

func ReadText(client Client) Kleisli[error, Requester, string]

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

type ReaderIOEither

type ReaderIOEither[R, E, A any] = readerioeither.ReaderIOEither[R, E, A]

type Requester

type Requester = ioeither.IOEither[error, *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