refactor: use http.NewRequestWithContext instead of http.NewRequest (#97)
This commit is contained in:
3
edits.go
3
edits.go
@@ -39,12 +39,11 @@ func (c *Client) Edits(ctx context.Context, request EditsRequest) (response Edit
|
||||
return
|
||||
}
|
||||
|
||||
req, err := http.NewRequest("POST", c.fullURL("/edits"), bytes.NewBuffer(reqBytes))
|
||||
req, err := http.NewRequestWithContext(ctx, http.MethodPost, c.fullURL("/edits"), bytes.NewBuffer(reqBytes))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
req = req.WithContext(ctx)
|
||||
err = c.sendRequest(req, &response)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user