Created
May 12, 2020 19:01
Revisions
-
kyleterry created this gist
May 12, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ // SetJSONBody is used to set a request body that is a JSON-encoded value. func (r *Request) SetJSONBody(val interface{}) error { buf, err := json.Marshal(val) if err != nil { return err } r.Obj = val r.BodyBytes = buf return nil }