restclient

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: GPL-3.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete added in v1.2.2

func Delete(url string) (*http.Response, error)

Delete performs an HTTP DELETE request.

func DeleteWithHeaders added in v1.2.2

func DeleteWithHeaders(url string, headers map[string]string) (*http.Response, error)

DeleteWithHeaders performs an HTTP DELETE request with headers.

func Get

func Get(url string) (*http.Response, error)

Get performs an HTTP GET request.

func GetWithHeaders added in v1.2.2

func GetWithHeaders(url string, headers map[string]string) (*http.Response, error)

GetWithHeaders performs an HTTP GET request with headers.

func Init

func Init()

Init initializes the restclient package.

func Post added in v1.2.2

func Post(url string, body []byte) (*http.Response, error)

Post performs an HTTP POST request.

func PostWithHeaders added in v1.2.2

func PostWithHeaders(url string, headers map[string]string, body []byte) (*http.Response, error)

PostWithHeaders performs an HTTP POST request with headers.

Types

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient defines an HTTP client interface to perform HTTP requests.

var (
	// Client is the http client used to make requests
	Client HTTPClient
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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