Trouble retrieving byte array response via HTTP Node

Hi all,
I’m having issues trying to access a third party API endpoint that returns a byte array as a response. The end point returns an image, but from what I can gather, it is returned as a byte array (the documentation is very sparse).

When attempting to use the HTTP node, I receive the following error when setting response type to file. I receive similar errors when trying JSON and string. We are still on 0.160.0 (planning to upgrade soon!)

{
  "message": "500 - {\"type\":\"Buffer\",\"data\":[60,104,49,62,83,101,114,118,101,114,32,69,114,114,111,114,32,40,53,48,48,41,60,47,104,49,62]}",
  "name": "Error",
  "stack": "Error: Request failed with status code 500\n    at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (events.js:327:22)\n    at endReadableNT (internal/streams/readable.js:1327:12)\n    at processTicksAndRejections (internal/process/task_queues.js:80:21)"
}

I’ve confirmed that the endpoint works as expected via Postman and via a quick and dirty c# console app

Hey @IbnJubayr,

Do you have a workflow that reproduces the issue?

Hey Jon,
I do, but I cannot easily share the API endpoint with you as it requires authentication :frowning:

My test workflow is a simple HTTP request node with the appropriate URL and credentials

Hey @IbnJubayr, the error you are seeing is the decimal representation of <h1>Server Error (500)</h1> (you can check this here or by simply changing the response format from file to string).

This is a server error on the receiving side, but would often indicate an error with the request. Could you share the documentation of the endpoint you are consuming or the curl request exported from Postman?

1 Like

Hey @MutedJam - here’s the API reference for the end point. Unfortunately it is quite sparse for this particular endpoint. I could send you a private message with some test credentials and an endpoint?

https://developers.opensolar.com/#system-image