Downloading a file with this client method:
@GET
@Path("/download")
@Produces(APPLICATION_PDF)
fun getDocument(): ByteArray
I get bytes as [37, 80, 68, 70, 45, 49, 46, 55, 10, 37, -17, -65, -67, ... more]
The PDF file is corrupted.
Downloading the same file with a curl
curl --request GET --url https://api.app/download --header 'accept: application/pdf' -o doc.pdf
I get bytes as [37, 80, 68, 70, 45, 49, 46, 55, 10, 37, -30, -29, -49, ... more]
The PDF file is fine.
I don't see what I can do to fix this.
In the logs I do see the query flying with proper headers:
DEBUG [org.jbo.res.rea.cli.log.DefaultClientLogger] (vert.x-eventloop-thread-0) MDC[ps= rpm= capi=] Request: GET https://api.app/download Headers[Accept=application/pdf User-Agent=MyServiceAPI (- / -) X-CorrelationID=srv00014.out01], Empty body
DEBUG [org.jbo.res.rea.cli.log.DefaultClientLogger] (vert.x-eventloop-thread-0) MDC[ps= rpm= capi=] Response: GET https://api.app/download, Status[200 OK], Headers[Access-Control-Allow-Origin=* Allow=GET Cache-Control=no-cache, private Content-Disposition=attachment; filename=doc.pdf Content-Type=application/pdf <other meaningless headers>], Body: