http

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Debug     bool                   // 是否开启debug模式
	Url       string                 // 请求地址
	Params    map[string]string      // 请求参数
	Header    map[string]string      // 请求头
	Form      map[string]interface{} // 表单参数
	UserAgent string                 // User-Agent
}

func (*Client) Get

func (Client *Client) Get() ([]byte, error)

Get get请求返回[]byte

func (*Client) Post

func (Client *Client) Post() ([]byte, error)

Post post请求返回[]byte

type GinHandle added in v0.0.4

type GinHandle struct{}

func (*GinHandle) DefaultQuery added in v0.0.4

func (*GinHandle) DefaultQuery(c *gin.Context, key string, defaultValue string) string

DefaultQuery 获取get参数,如果没有则返回默认值

func (*GinHandle) Param added in v0.0.4

func (*GinHandle) Param(c *gin.Context, key string) string

Param 获取路由参数

func (*GinHandle) Query added in v0.0.4

func (*GinHandle) Query(c *gin.Context, key string) string

Query 获取get参数

func (*GinHandle) ShouldBind added in v0.0.4

func (*GinHandle) ShouldBind(c *gin.Context, s interface{}) error

ShouldBind Get绑定到结构体

func (*GinHandle) ShouldBindJSON added in v0.0.4

func (*GinHandle) ShouldBindJSON(c *gin.Context, s interface{}) error

ShouldBindJSON Post绑定到结构体

Jump to

Keyboard shortcuts

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