http

package
v1.5.25 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: MIT Imports: 5 Imported by: 4 modules, 3 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

This section is empty.

Functions

This section is empty.

Types

type ClientProvider

type ClientProvider struct {
	// contains filtered or unexported fields
}

ClientProvider ...

func NewClientProvider

func NewClientProvider(timeout time.Duration, allowRedirect bool) *ClientProvider

NewClientProvider initiate a new client object

timeout - http request time
allowRedirect - allow request redirects on requested url or not

func (*ClientProvider) Request

func (h *ClientProvider) Request(url string, method string, header map[string]string, body []byte, params map[string]string) (statusCode int, resBody []byte, err error)

Request http

func (*ClientProvider) RequestCSV

func (h *ClientProvider) RequestCSV(url string) ([][]string, error)

RequestCSV requests http API that returns csv result

func (*ClientProvider) RequestWithResponse added in v1.2.3

func (h *ClientProvider) RequestWithResponse(url string, method string, header map[string]string, body []byte, params map[string]string) (*http.Response, []byte, error)

RequestWithResponse http

type Response

type Response struct {
	StatusCode int
	Body       []byte
}

Response returned from http request

Jump to

Keyboard shortcuts

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