File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -86,19 +86,19 @@ export abstract class APIClient {
86
86
// eslint-disable-next-line @typescript-eslint/no-explicit-any
87
87
appendBodyToFormData ( formDataRequest . formData , opts . body as Record < string , any > ) ;
88
88
}
89
-
89
+
90
90
const headers = {
91
91
...opts ?. headers ,
92
92
...formDataRequest . headers ,
93
93
} ;
94
-
94
+
95
95
const options : FinalRequestOptions = {
96
96
method : 'post' ,
97
97
path : path ,
98
98
body : formDataRequest . formData ,
99
99
headers,
100
100
} ;
101
-
101
+
102
102
return this . performRequest ( options ) . then ( ( response ) => this . fetch . handleResponse < Rsp > ( response ) as Rsp ) ;
103
103
} ) ;
104
104
}
Original file line number Diff line number Diff line change 1
1
import { FinalRequestOptions , CrossPlatformResponse } from 'types' ;
2
2
import { BaseFetch } from './BaseFetch' ;
3
3
import { Stream , NodeSSEDecoder } from '../streaming' ;
4
+ import { NodeHTTPBody } from 'types/API' ;
4
5
5
6
export class NodeFetch extends BaseFetch {
6
7
async call ( url : string , options : FinalRequestOptions ) : Promise < CrossPlatformResponse > {
@@ -10,7 +11,7 @@ export class NodeFetch extends BaseFetch {
10
11
return nodeFetch ( url , {
11
12
method : options . method ,
12
13
headers : options ?. headers ? ( options . headers as Record < string , string > ) : undefined ,
13
- body : options ?. body ? ( options . body as import ( 'form-data' ) | string ) : undefined ,
14
+ body : options ?. body ? ( options . body as NodeHTTPBody ) : undefined ,
14
15
} ) ;
15
16
}
16
17
Original file line number Diff line number Diff line change @@ -33,3 +33,5 @@ export type CrossPlatformReadableStream = ReadableStream<Uint8Array> | import('s
33
33
export type UnifiedFormData = FormData | import ( 'form-data' ) ;
34
34
35
35
export type FormDataRequest = { formData : UnifiedFormData ; headers : Headers } ;
36
+
37
+ export type NodeHTTPBody = string | import ( 'form-data' ) ;
You can’t perform that action at this time.
0 commit comments