Estoy tratando de usar angular-file-uploader y cargar un archivo. en afuConfig, quiero establecer el método POST pero en la terminal tengo errores.
uploadAPI: { url:"https://example-file-upload-api", method:"POST", headers: { "Content-Type" : "text/plain;charset=UTF-8", }, }me da esto:
The types of 'uploadAPI.responseType' are incompatible between these types. Type 'string' is not assignable to type '"blob" | "json" | "arraybuffer" | "text" | undefined'.Tengo el mismo problema para usar el tipo de respuesta también.
El tipo de responseType predeterminado es json . Intente asignar el tipo de responseType: text explícitamente
uploadAPI: { url: "https://example-file-upload-api", method:"POST", headers: { "Content-Type" : "text/plain;charset=UTF-8", }, responseType: 'text' }intente debajo del código para los encabezados:
httpOptions: { headers:{ accept: 'application/pdf' } responseType: 'blob', }