Using the HTTP node and dealing with base64 response

I’m using the HTTP node to send a request to an API endpoint that returns a JPEG filetype as content.

I’m printing the response to the terminal and it looks like it’s coming in base64 format, but the terminal looks like it’s cutting off the base64 after a certain amount, and I (weirdly) hear like ‘beep beep beep’ coming from my Terminal or Hackeet or somewhere. I’m going crazy aren’t I? :joy:

After this node step that prints the partial response, none of the other steps seem to run and the terminal needs to be quit and then run the Hackeet project again to try again.

Does anyone have any experience trying to use the HTTP node for calling endpoints that return files in base64? Are there any nodes to help deal with the data? @Thierry ?

Hi Richard,
JPEG files, like binary files, are not made up of printable characters and are not intended to be printed on standard output (which is why you hear strange sounds when you try to do so). Nevertheless, you can save the results of an HTTP node to your hard drive or even to a MongoDB database after encoding it if it is not already encoded.
You can find an example here after.
Downloading and saving images

1 Like