Files
dependabot[bot] 23b76b42b0 Bump github.com/gin-gonic/gin from 1.7.7 to 1.9.0 in /_example (#368)
Bumps [github.com/gin-gonic/gin](https://github.com/gin-gonic/gin) from 1.7.7 to 1.9.0.
- [Release notes](https://github.com/gin-gonic/gin/releases)
- [Changelog](https://github.com/gin-gonic/gin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gin-gonic/gin/compare/v1.7.7...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/gin-gonic/gin
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-08 19:46:01 +08:00
..
2020-01-29 21:58:46 +08:00
2021-08-04 13:47:49 +08:00
2019-12-04 21:15:13 +08:00
2019-12-08 14:01:38 +08:00
2019-12-04 21:15:13 +08:00
2019-12-08 14:01:38 +08:00
2020-01-14 23:12:25 +08:00
2020-01-30 19:31:36 +08:00
2020-02-24 21:53:20 +08:00

how to use gout

设置http body

写入JSON到http body里面

SetJSON接口写入json至http.body里

设置和解析xml

使用SetXML写入xml格式数据使用BindXML读取

设置和解析yaml

使用SetYAML写入yaml格式数据使用BindYAML读取

设置formdata

使用SetForm接口接入form-data格式数据该接口支持多种数据类型。

upload file

这里使用的是SetBody进行上传文件

设置非json/xml/yaml数据到body

需要使用SetBody接口

解析非json/xml/yaml数据body到变量里面

需要使用BindBody接口

设置控制字段

设置Query Parameters

需要使用SetQuery接口,该接口支持多种数据类型

设置http header

需要使用SetHeader接口,丰富的数据类型让你停不下来

解析http header

需要BindHeader接口,支持多类型自动绑定

设置timeout

需使用SetTimeout接口

取消一个正在发送的请求

使用WithContext接口可取消正在发送的请求

发送x-www-form-urlencoded格式数据

使用SetWWWForm接口

处理多种body一个接口既可以处理json也可以处理html 404

使用Callback接口

设置cookie

使用SetCookies接口可传一个或者多个cookie

修改传输成为unixsocket

debug 模式

打开debug模式or 打开debug关闭颜色高亮

都是使用Debug()接口,只是里面传递的策略函数不一样

自定义debug模式

debug接口具有强大的扩展性能简单啪啪两下写个策略函数就可以扩展该接口比如设置某个环境变量才打开debug接口

trace 功能,主要诊断接口各个阶段的性能

Debug()里面传递 gout.Trace()策略函数就可以打开这个功能

保存debug信息

自定义Debug()接口的策略函数

压测功能

压测一定次数

Number()控制次数

压测固定时间

Durations()控制时间

已某个固定频率压测

Rate()控制压测频率

压测功能和apache ab 的对比远比ab性能要好

与apache ab的性能pk

基于回调函数的自定义压测模式

Loop()接口可传递回调函数

import

导入纯文本请求并发送

RawText()接口可完成该功能

export

生成curl命令

Curl().Do()可实现

指数回退重试

重试

Retry()下面的接口

使用冷备地址进行重试

Func()可传回调函数进行自定义设置

基于某个http code进行重试比如ES 返回209告知资源不可用

Func() 的入参有code信息使用filter.ErrRetry告知gout需要重试

socks5