httpx

package
v0.0.0-...-7ed4ab3 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBuffer

func GetBuffer() *bytes.Buffer

func NewStaticHandler

func NewStaticHandler() http.HandlerFunc

func PutBuffer

func PutBuffer(buf *bytes.Buffer)

func SetMaxMultipartMemory

func SetMaxMultipartMemory(max int64)

Types

type Context

type Context struct {
	StatusCode int
	// contains filtered or unexported fields
}

func NewContext

func NewContext(resp http.ResponseWriter, req *http.Request) *Context

func (*Context) GetFormValue

func (own *Context) GetFormValue(key string) string

func (*Context) GetHeader

func (own *Context) GetHeader(key string) string

func (*Context) GetMethod

func (own *Context) GetMethod() string

func (*Context) GetMultipartFormValue

func (own *Context) GetMultipartFormValue(key string) string

func (*Context) GetPathValue

func (own *Context) GetPathValue(name string) string

func (*Context) GetPostFormValue

func (own *Context) GetPostFormValue(key string) string

func (*Context) GetQueryValue

func (own *Context) GetQueryValue(key string) string

func (*Context) GetRequest

func (own *Context) GetRequest() *http.Request

func (*Context) GetResponse

func (own *Context) GetResponse() http.ResponseWriter

func (*Context) GetURL

func (own *Context) GetURL() *url.URL

func (*Context) ReadJson

func (own *Context) ReadJson(data any) error

func (*Context) ResponseFile

func (own *Context) ResponseFile(filename string)

func (*Context) ResponseHTML

func (own *Context) ResponseHTML(filename, tmplname string, data any)

func (*Context) ResponseJSON

func (own *Context) ResponseJSON(code int, data any)

func (*Context) ResponseSSE

func (own *Context) ResponseSSE(sse func() <-chan []byte)

func (*Context) ResponseUpgrade

func (own *Context) ResponseUpgrade(upgrade func(conn net.Conn))

func (*Context) WithContext

func (own *Context) WithContext(ctx context.Context) *Context

func (*Context) WithHeader

func (own *Context) WithHeader(key, value string) *Context

Jump to

Keyboard shortcuts

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