We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
保持核心的精简
把数据包里面的hello修改为demo
type demoRequestMiddler struct{} func (d *demoRequestMiddler) ModifyRequest(req *http.Request) error { req.Body = ioutil.NopCloser(strings.NewReader("demo")) req.ContentLength = 4 return nil } func demoRequest() api.RequestMiddler { return &demoRequestMiddler{} } func Test_RequestModify(t *testing.T) { New().POST(ts.URL).RequestUse(demoRequest()).SetBody("hello").BindBody(&s).Do() assert.NoError(t, err, fmt.Sprintf("test url:%s", ts.URL)) assert.Equal(t, s, "demo") }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
目的
保持核心的精简
接口
通过中间件修改请求数据包
把数据包里面的hello修改为demo
The text was updated successfully, but these errors were encountered: