Page 1 of 1

getResponseBody() returns a string getMediaData() is null

PostPosted: Mon Jul 05, 2021 12:45 am
by roddy
When using an HTTP GET request to retrieve a PDF from an AWS S3 bucket, I can only retrieve the data using getResponseBody() which returns it as a string (not so good) but the getMediaData() is only returning null. I thought it would be an interpretation of the same data?

Using plugins.http.getMediaData() works fine but if there is an exception then it bypasses the try/catch and just crashes the app (it sometimes appears as an exception later).
If anyone could shed any light on the reasons a getMediaData() will only return null, even when there is data coming back from the getResponseBody(), it would be very much appreciated.