easy_http

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2022 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGet

func NewGet(url string) *requestHandler

func NewPost

func NewPost(url string, body string) *requestHandler

func NewRequest

func NewRequest(method Method, u string, config *RequestConfig) *requestHandler

func NewResponse

func NewResponse(resp *http.Response, duration time.Duration, log *zap.Logger) *response

Types

type Method

type Method int
const (
	GET Method = iota
	POST
	PUT
	HEAD
	DELETE
	PATCH
	OPTION
)

func (Method) String

func (m Method) String() string

type RequestConfig

type RequestConfig struct {
	Http2          bool
	Headers        map[string][]string
	Cookies        map[string][]string
	Body           string
	Timeout        time.Duration
	FollowRedirect bool
	ProxyUrl       string
	IgnoreTLS      bool
}

核心配置结构

Jump to

Keyboard shortcuts

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