diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2026-07-21 14:23:40 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2026-07-21 14:23:40 +0200 |
| commit | 044e297413066262c54beb33e98d0e498178897b (patch) | |
| tree | 8fa631ebe958f0a480bbe9445ac83c13b36f1d97 /account.go | |
| parent | dc7bd11d855f0b3266612a18606801f4e09ecc09 (diff) | |
| download | go-schwift-044e297413066262c54beb33e98d0e498178897b.tar.gz | |
use http.MethodFoo constants where possible
Diffstat (limited to 'account.go')
| -rw-r--r-- | account.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -105,7 +105,7 @@ func (a *Account) Headers(ctx context.Context) (AccountHeaders, error) { } resp, err := Request{ - Method: "HEAD", + Method: http.MethodHead, ExpectStatusCodes: []int{204}, }.Do(ctx, a.backend) if err != nil { @@ -136,7 +136,7 @@ func (a *Account) Invalidate() { // A successful POST request implies Invalidate() since it may change metadata. func (a *Account) Update(ctx context.Context, headers AccountHeaders, opts *RequestOptions) error { resp, err := Request{ - Method: "POST", + Method: http.MethodPost, Options: cloneRequestOptions(opts, headers.Headers), ExpectStatusCodes: []int{204}, }.Do(ctx, a.backend) @@ -153,7 +153,7 @@ func (a *Account) Update(ctx context.Context, headers AccountHeaders, opts *Requ // A successful PUT request implies Invalidate() since it may change metadata. func (a *Account) Create(ctx context.Context, opts *RequestOptions) error { resp, err := Request{ - Method: "PUT", + Method: http.MethodPut, Options: opts, ExpectStatusCodes: []int{201, 202}, DrainResponseBody: true, |
