client

package
v0.0.0-...-c05b6d7 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpClient

type HttpClient struct {
	Client http.Client
}

HttpClient implements a client for sending HTTP requests, while automating some busywork such as closing response bodies.

func NewHttpClient

func NewHttpClient(timeout time.Duration) *HttpClient

func (*HttpClient) Do

func (hc *HttpClient) Do(req *http.Request) (*Resp, error)

Do is a simplified version of http.Client.Do that reads the response body and returns it as a byte slice.

type Resp

type Resp struct {
	Code   int
	Body   []byte
	Header http.Header
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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