Download PDF from third party API using forge fetch API

Venkat June 16, 2023

I am using the forge fetch api to get a application/pdf type response content.

The forge fetch api call is as below,

            method: 'GET',
    ).then(async (resp) => {  
        console.log(await resp.arrayBuffer());   // logs "{}" in my console 

resp.arrayBuffer() always return a empty JSON Object rather than a buffer array.
Can someone help me with this?

The Response Headers of the fetch call are
'accept-ranges': 'bytes'
'content-length': '227150'
'content-type': 'application/pdf'

1 answer

0 votes
Stanisław Moska
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 11, 2024

Did you find a solution?


Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events