request

package
v1.0.1005 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

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

*

  • 请求 *
  • @create 2021-9-15
  • @author deatil

func New

func New() *Request

使用

func (*Request) Bind

func (this *Request) Bind(obj any) error

绑定

func (*Request) BindHeader

func (this *Request) BindHeader(obj any) error

绑定 BindHeader

func (*Request) BindJSON

func (this *Request) BindJSON(i any) error

绑定 json

func (*Request) BindQuery

func (this *Request) BindQuery(obj any) error

绑定 query

func (*Request) BindUri

func (this *Request) BindUri(obj any) error

绑定 BindUri

func (*Request) BindXML

func (this *Request) BindXML(obj any) error

绑定 xml

func (*Request) BindYAML

func (this *Request) BindYAML(obj any) error

绑定 BindYAML

func (*Request) ClientIP

func (this *Request) ClientIP() string

客户端IP

func (*Request) ContentType

func (this *Request) ContentType() string

ContentType

func (*Request) Cookie

func (this *Request) Cookie(name string) (string, error)

获取 cookie

func (*Request) DefaultPostForm

func (this *Request) DefaultPostForm(key, defaultValue string) string

表单请求

func (*Request) DefaultQuery

func (this *Request) DefaultQuery(key string, def any) string

带默认

func (*Request) FormFile

func (this *Request) FormFile(name string) (*multipart.FileHeader, error)

表单文件上传

func (*Request) FullPath

func (this *Request) FullPath() string

完整匹配路径

func (*Request) GetContext

func (this *Request) GetContext() *router.Context

获取上下文

func (*Request) GetHeader

func (this *Request) GetHeader(key string) string

GetHeader

func (*Request) GetPostForm

func (this *Request) GetPostForm(key string) (string, bool)

表单请求

func (*Request) GetPostFormArray

func (this *Request) GetPostFormArray(key string) ([]string, bool)

表单请求

func (*Request) GetPostFormMap

func (this *Request) GetPostFormMap(key string) (map[string]string, bool)

表单请求

func (*Request) GetQuery

func (this *Request) GetQuery(key string) (string, bool)

查询数据

func (*Request) GetQueryArray

func (this *Request) GetQueryArray(key string) ([]string, bool)

获取数组

func (*Request) GetQueryMap

func (this *Request) GetQueryMap(key string) (map[string]string, bool)

GetQueryMap

func (*Request) GetRawData

func (this *Request) GetRawData() ([]byte, error)

GetRawData

func (*Request) IsWebsocket

func (this *Request) IsWebsocket() bool

IsWebsocket

func (*Request) JSON

func (this *Request) JSON(code int, data any)

json

func (*Request) MultipartForm

func (this *Request) MultipartForm() (*multipart.Form, error)

表单批量返回

func (*Request) MustBindWith

func (this *Request) MustBindWith(obj any, b router.Binding) error

绑定 MustBindWith

func (*Request) Param

func (this *Request) Param(key string) string

查询数据

func (*Request) PostForm

func (this *Request) PostForm(key string) string

表单请求

func (*Request) PostFormArray

func (this *Request) PostFormArray(key string) []string

表单请求

func (*Request) PostFormMap

func (this *Request) PostFormMap(key string) map[string]string

表单请求

func (*Request) Query

func (this *Request) Query(key string) string

查询数据

func (*Request) QueryArray

func (this *Request) QueryArray(key string) []string

获取数组

func (*Request) QueryMap

func (this *Request) QueryMap(key string) map[string]string

map

func (*Request) RemoteIP

func (this *Request) RemoteIP() string

RemoteIP

func (*Request) ShouldBind

func (this *Request) ShouldBind(obj any) error

func (*Request) ShouldBindBodyWith

func (this *Request) ShouldBindBodyWith(obj any, bb router.BindingBody) error

func (*Request) ShouldBindHeader

func (this *Request) ShouldBindHeader(obj any) error

func (*Request) ShouldBindJSON

func (this *Request) ShouldBindJSON(obj any) error

func (*Request) ShouldBindJSONWith

func (this *Request) ShouldBindJSONWith(obj any) error

func (*Request) ShouldBindQuery

func (this *Request) ShouldBindQuery(obj any) error

func (*Request) ShouldBindUri

func (this *Request) ShouldBindUri(obj any) error

func (*Request) ShouldBindWith

func (this *Request) ShouldBindWith(obj any, b router.Binding) error

func (*Request) ShouldBindXML

func (this *Request) ShouldBindXML(obj any) error

func (*Request) ShouldBindYAML

func (this *Request) ShouldBindYAML(obj any) error

func (*Request) Stream

func (this *Request) Stream(step func(w io.Writer) bool) bool

Stream

func (*Request) Value

func (this *Request) Value(key any) any

Value

func (*Request) WithContext

func (this *Request) WithContext(ctx *router.Context) *Request

设置上下文

Jump to

Keyboard shortcuts

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