feat: get header from sendRequestRaw (#694)

* feat: get header from sendRequestRaw

* Fix ci lint
This commit is contained in:
Qiying Wang
2024-04-06 03:15:54 +08:00
committed by GitHub
parent 0925563e86
commit 2646bce71c
3 changed files with 16 additions and 12 deletions

View File

@@ -4,7 +4,6 @@ import (
"bytes"
"context"
"fmt"
"io"
"net/http"
"os"
)
@@ -159,13 +158,12 @@ func (c *Client) GetFile(ctx context.Context, fileID string) (file File, err err
return
}
func (c *Client) GetFileContent(ctx context.Context, fileID string) (content io.ReadCloser, err error) {
func (c *Client) GetFileContent(ctx context.Context, fileID string) (content RawResponse, err error) {
urlSuffix := fmt.Sprintf("/files/%s/content", fileID)
req, err := c.newRequest(ctx, http.MethodGet, c.fullURL(urlSuffix))
if err != nil {
return
}
content, err = c.sendRequestRaw(req)
return
return c.sendRequestRaw(req)
}