Tools to Capture and Convert the Web
GrabzIt's Online Community

Como puedo consumir el servicio desde Angular +/8

Ask questions on how to capture or convert web pages or HTML into images, CSV, PDF or DOCX documents as well on how to convert videos into animated GIF's using our API.

Buenas tardes, me gustaría intentar probar este servicio para convertir informes Web que están en las últimas versiones de Angular, 
quiero saber de que manera puedo consumir la Rest Api sin utilizar Json, ya que veo que en su ejemplo por POSTMAN que envian los valores por medio de form-data.

Saludos,

Asked by anonymous on the 23rd of March 2021

The REST API is JSON based but you can get the same functionality in many different languages including PHP, JavaScript etc.

Answered by GrabzIt Support on the 23rd of March 2021

Thanks GRABZIT Support for your answer.

I POST the request with Angular fine, simulate PostMan example.

Now my problem is that rest api response me "file = {type: 0}"

GRABZIT support HTML5 with highcharts ???

gratitude!

Answered by anonymous on the 23rd of March 2021

It's probably because it's returning a file in the response and postman can't handle it. JSON should only be returned if there is an error.

Answered by GrabzIt Support on the 23rd of March 2021

No me retorno ningún archivo, me retorna un objeto que lo unico que tiene es --  file = {type: 0}

no encuentro ninguna cadena de bytes para descargar como PDF

Seguiré intentado.

Saludos,

Answered by anonymous on the 23rd of March 2021

Mi código es este

ExportPDFAPI(Info: any): Observable<any> {

const a = 'https://api.grabz.it/services/convert.ashx';
    let formData = new FormData();
    formData.append('key', Info.key);
    formData.append('format', Info.format);
    formData.append('html', Info.html);  
    const options = { responseType: "Blob"  };    
    const req = new HttpRequest('POST', a, formData, {responseType: "blob"});
    return this.http.request(req);

}

Answered by anonymous on the 23rd of March 2021

I don't think this is a GrabzIt error but a issue with how you are using Angular. Here is a description of something similar.

Answered by GrabzIt Support on the 23rd of March 2021