mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-14 12:23:41 +08:00
♻️ refactor: 重构speech接口
This commit is contained in:
@@ -103,6 +103,15 @@ func (c *Client) SendRequest(req *http.Request, response any) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Client) SendRequestRaw(req *http.Request) (body io.ReadCloser, err error) {
|
||||
resp, err := HttpClient.Do(req)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
return resp.Body, nil
|
||||
}
|
||||
|
||||
func IsFailureStatusCode(resp *http.Response) bool {
|
||||
return resp.StatusCode < http.StatusOK || resp.StatusCode >= http.StatusBadRequest
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user