Skip to content

Commit

Permalink
feat(client): allow binary returns (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Nov 6, 2023
1 parent 5d5c89e commit d78d2c6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/requestconfig/requestconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ func (cfg *RequestConfig) Execute() (err error) {
if cfg.ResponseBodyInto == nil {
return nil
}

if responseBodyInto, ok := cfg.ResponseBodyInto.(**http.Response); ok {
*responseBodyInto = res
return nil
}

contents, err := io.ReadAll(res.Body)
if err != nil {
return fmt.Errorf("error reading response body: %w", err)
Expand Down

0 comments on commit d78d2c6

Please sign in to comment.