File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ type RequestOptions = {
1212 params ?: Record < string , string | number > ;
1313 body ?: any ;
1414 timeout ?: number ;
15+ responseType ?: AxiosRequestConfig [ "responseType" ] ;
1516 raise_error ?: boolean ; // default: true
1617} ;
1718
@@ -163,12 +164,14 @@ class ApiClient {
163164 headers,
164165 params,
165166 timeout,
167+ responseType,
166168 raise_error = true ,
167169 } : RequestOptions ) : Promise < ApiResponse < T > > {
168170 const config : AxiosRequestConfig = {
169171 headers,
170172 params,
171173 timeout,
174+ responseType,
172175 httpsAgent : this . axiosAgent ,
173176 } ;
174177 return this . requestWrapper < T > (
Original file line number Diff line number Diff line change @@ -59,7 +59,10 @@ async function convertUrlsToBase64(
5959) : Promise < Array < { url : string ; base64 : string } > > {
6060 const screenshots = await Promise . all (
6161 urls . map ( async ( url ) => {
62- const response = await apiClient . get ( { url } ) ;
62+ const response = await apiClient . get ( {
63+ url,
64+ responseType : "arraybuffer"
65+ } ) ;
6366 // Axios returns response.data as a Buffer for binary data
6467 const base64 = Buffer . from ( response . data ) . toString ( "base64" ) ;
6568
You can’t perform that action at this time.
0 commit comments