http

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClient = &http.Client{}
View Source
var DefaultHeader = map[string]string{
	"User-Agent": "jk-http-client/1.7.1",
}

Functions

func Get

func Get(url string, headers ...map[string]string) ([]byte, error)

func ListenAndServe added in v1.9.0

func ListenAndServe(listen string, mux *Mux) error

func Post

func Post(url string, data any, headers ...map[string]string) ([]byte, error)

func Raw

func Raw(method, url string, data []byte, headers map[string]string) ([]byte, error)

Types

type Mux added in v1.9.0

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

func NewMux added in v1.9.0

func NewMux() *Mux

func (*Mux) Any added in v1.9.0

func (m *Mux) Any(name string, fn func(Request) *response.Response)

func (*Mux) Delete added in v1.9.0

func (m *Mux) Delete(name string, fn func(Request) *response.Response)

func (*Mux) Get added in v1.9.0

func (m *Mux) Get(name string, fn func(Request) *response.Response)

func (*Mux) Post added in v1.9.0

func (m *Mux) Post(name string, fn func(Request) *response.Response)

func (*Mux) Put added in v1.9.0

func (m *Mux) Put(name string, fn func(Request) *response.Response)

func (*Mux) RegisterRoute added in v1.9.0

func (m *Mux) RegisterRoute(method, name string, fn func(Request) *response.Response)

func (*Mux) Trace added in v1.9.0

func (m *Mux) Trace(name string)

type Request added in v1.9.0

type Request struct {
	*http.Request
}

func (*Request) Unmarshal added in v1.9.0

func (r *Request) Unmarshal(v any) error

Jump to

Keyboard shortcuts

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