cHTTPClient

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 10 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 HTTPStream added in v0.1.2

type HTTPStream struct {
	Field string
	End   string
	Body  chan string
}

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  *HTTPStream
}

type Response added in v0.0.52

type Response struct {
	Header     http.Header
	Status     string
	StatusCode int
	Body       []byte
}

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