(
url: string,
file: File,
fieldName = 'file',
config?: FullRequestConfig
)
| 370 | |
| 371 | // File upload |
| 372 | public upload<T = any>( |
| 373 | url: string, |
| 374 | file: File, |
| 375 | fieldName = 'file', |
| 376 | config?: FullRequestConfig |
| 377 | ): Promise<T> { |
| 378 | const formData = new FormData() |
| 379 | formData.append(fieldName, file) |
| 380 | |
| 381 | return this.post(url, formData, { |
| 382 | headers: { |
| 383 | 'Content-Type': 'multipart/form-data', |
| 384 | }, |
| 385 | ...config, |
| 386 | }) |
| 387 | } |
| 388 | |
| 389 | // Download file |
| 390 | public download(url: string, config?: FullRequestConfig): Promise<Blob> { |
no test coverage detected