Skip to content

Commit

Permalink
Support slice and array in SetBody
Browse files Browse the repository at this point in the history
  • Loading branch information
imroc committed Jan 31, 2023
1 parent bc78993 commit a6c58eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion request.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ func (r *Request) SetBody(body interface{}) *Request {
default:
t := reflect.TypeOf(body)
switch t.Kind() {
case reflect.Ptr, reflect.Struct, reflect.Map:
case reflect.Ptr, reflect.Struct, reflect.Map, reflect.Slice, reflect.Array:
r.marshalBody = body
default:
r.SetBodyString(fmt.Sprint(body))
Expand Down

0 comments on commit a6c58eb

Please sign in to comment.