Having the following server response
cache-control: no-cacheno-storemax-age=0must-revalidate
connection: keep-alive
content-disposition: attachment; filename="filename.bpmn.xml"
content-encoding: gzip
content-type: application/xml
date: Tue24 Nov 2020 02:35:02 GMT
expires: 0
keep-alive: timeout=60
pragma: no-cache
transfer-encoding: chunked
vary: accept-encoding,origin,access-control-request-headers,access-control-request-method,accept-encoding
x-content-type-options: nosniff
x-frame-options: DENY
x-xss-protection: 1; mode=block
How can I get the content of the file to download from the response body?
I get this header by inspecting the response header of an endpoint in swagger
Right now when trying the next action
fetch(basename: string): Observable<any> {
return this.httpClient.get(ApiEndpoints.ENTRY, {
headers: new HttpHeaders({
'Access-Control-Expose-Headers': 'Content-Disposition',
'Content-Disposition': 'attachment',
'Content-Type': 'application/xml',
Accept: 'application/xml'
}),
params: new HttpParams().set('object', basename)
});
}
Get the following error
net::ERR_CONTENT_DECODING_FAILED 200 (OK)
Along with the following error message
Http failure response for /api/bpm/download: 0 Unknown Error
Update 0
Error object
Update 1
In the following example I share the result that returns when testing in Swagger. In case there is any indication that I overlook.
Highlighted is the file that returns when calling the endpoint. And from which I need to get its content
Thanks for your comments