cHTTPClient

package module
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPMethod

type HTTPMethod string
const (
	MethodHEAD    HTTPMethod = "HEAD"
	MethodGET     HTTPMethod = "GET"
	MethodPOST    HTTPMethod = "POST"
	MethodOPTIONS HTTPMethod = "OPTIONS"
	MethodDELETE  HTTPMethod = "DELETE"
	MethodPUT     HTTPMethod = "PUT"
	MethodPATCH   HTTPMethod = "PATCH"
	MethodTRACE   HTTPMethod = "TRACE"
	MethodCONNECT HTTPMethod = "CONNECT"
)

type Option

type Option struct {
	Host            string
	Uri             string
	Method          HTTPMethod
	Timeout         time.Duration
	Try             int
	Headers         map[string]string
	Query           map[string]string
	Data            string
	Stream          chan string                                                 `json:"-"`
	ResponseHandler func(ctx *gin.Context, response *http.Response) (err error) `json:"-"`
}

type Response added in v0.0.52

type Response struct {
	Header     http.Header
	Status     string
	StatusCode int
	Body       []byte `json:"-"`
}

func Request

func Request(ctx *gin.Context, option Option) (result *Response, err error)

Jump to

Keyboard shortcuts

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