Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#1782)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Apr 24, 2024
1 parent 2158081 commit 0eb1345
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Setup go
uses: actions/setup-go@v5

- run: |
go build ./...
7 changes: 5 additions & 2 deletions option/requestoption.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ func WithResponseInto(dst **http.Response) RequestOption {
}
}

// WithRequestBody returns a RequestOption that provides a custom serialized body with content type.
// WithRequestBody returns a RequestOption that provides a custom serialized body with the given
// content type.
//
// body accepts an io.Reader or raw []bytes.
func WithRequestBody(contentType string, body any) RequestOption {
return func(r *requestconfig.RequestConfig) error {
if reader, ok := body.(io.Reader); ok {
Expand All @@ -204,7 +207,7 @@ func WithRequestBody(contentType string, body any) RequestOption {
return r.Apply(WithHeader("Content-Type", contentType))
}

return fmt.Errorf("body is must either be a byte slice or implement io.Reader")
return fmt.Errorf("body must be a byte slice or implement io.Reader")
}
}

Expand Down

0 comments on commit 0eb1345

Please sign in to comment.