I'm trying to retrieve a PDF report from API, so I basically call '/api/2.0/fo/report/' with action fetch and a report_id which returns a response with content_type = application/pdf.
That sounds corrent to me.
The problem comes when trying to save it to a file.
My Python code is like this:
with open('output/TEST.pdf', 'wb') as f:
I did many tests anyway, with different values in encode, and TEXT.pdf cannot be open as Windows says it is corrupted.
Could you please guys give me a hand to get the response in a PDF file?