diff --git a/pkg/requests/requests.go b/pkg/requests/requests.go index da3c3af..07e19cc 100644 --- a/pkg/requests/requests.go +++ b/pkg/requests/requests.go @@ -121,6 +121,11 @@ func (t *requests) Form(form url.Values) *requests { return t } +func (t *requests) JSONBody(data interface{}) *requests { + b, _ := json.Marshal(data) + return t.ContentType(ContentTypeJSON).Data(b) +} + func (t *requests) Body(body io.Reader) *requests { t.body = body return t