package http
import "github.com/IBM/fp-go/ioeither/http"
Index ¶
- Variables
- func MakeBodyRequest(method string, body IOE.IOEither[error, []byte]) func(url string) IOE.IOEither[error, *http.Request]
- func ReadAll(client Client) func(Requester) IOE.IOEither[error, []byte]
- func ReadFullResponse(client Client) func(Requester) IOE.IOEither[error, H.FullResponse]
- func ReadJSON[A any](client Client) func(Requester) IOE.IOEither[error, A]
- func ReadJson[A any](client Client) func(Requester) IOE.IOEither[error, A]
- func ReadText(client Client) func(Requester) IOE.IOEither[error, string]
- type Client
- type Requester
Variables ¶
var ( // MakeRequest is an eitherized version of [http.NewRequest] MakeRequest = IOE.Eitherize3(http.NewRequest) // specialize MakeGetRequest = makeRequest("GET", nil) )
Functions ¶
func MakeBodyRequest ¶
func MakeBodyRequest(method string, body IOE.IOEither[error, []byte]) func(url string) IOE.IOEither[error, *http.Request]
MakeBodyRequest creates a request that carries a body
func ReadAll ¶
ReadAll sends a request and reads the response as bytes
func ReadFullResponse ¶
ReadFullResponse sends a request, reads the response as a byte array and represents the result as a tuple
func ReadJSON ¶
ReadJSON sends a request, reads the response and parses the response as JSON
func ReadJson ¶
ReadJson sends a request, reads the response and parses the response as JSON
Deprecated: use ReadJSON instead
func ReadText ¶
ReadText sends a request, reads the response and represents the response as a text string
Types ¶
type Client ¶
func MakeClient ¶
type Requester ¶
Requester is a reader that constructs a request
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
ioeither/http/builder | |
ioeither/http/di |
- Version
- v1.0.151 (latest)
- Published
- Nov 23, 2024
- Platform
- linux/amd64
- Imports
- 11 packages
- Last checked
- 5 months ago –
Tools for package owners.