cHTTPClient

package module
v0.0.205 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Request

func Request(ctx *gin.Context, option Option) (header http.Header, body []byte, err error)

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
}

Jump to

Keyboard shortcuts

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