I'm trying to make a method which download the return the API to XML file.
I did this method to make the request in the API:
public getXML(ano:any,mes:any,glosadas:any):Observable<Blob>{
const token = this.token.retornaToken();
const headers = new HttpHeaders({Authorization:`Bearer ${token}`});
return this.http.get(`API/xml?TpoRelatorio=1&NroGspContratado=&NroProtocolo=&NmeCliente=&SomenteGlosadas=${glosadas}&Ano=${ano}&Mes=${mes}&Page=1&Count=999999999`,{ headers, responseType:'blob' })}
I thought that was just needed to call getXML()
in component.ts, but it didn't worked...
What should I do in component.ts?