Variable in HTTP GET URL makes the response wrong

Really bad title of the post but I don't know how else to explain it :sweat_smile:

I have been using variables in the URL field of my HTTP Request nodes for months without issue, but today I tried something new.

I am pulling a PDF from an API, and returning the result as a binary buffer for further processing.
If I write the full URL to the file in the URL field, I get the correct binary buffer back.

But if I substitute the last part of the URL with a variable, I get the wrong buffer back and the file becomes corrupt when saving it.

Example of full URL:
https://example.com/files/invoice.pdf

Example of URL with variable:
https://example.com/files/{{filename}}

msg.filename is of course set to invoice.pdf

Anyone know why this is happening?

Can you show us the info properties for the HTTP Request

also, export the problematic flow (just the inject and http node)

I don't really want the public to see parts of this flow, but I guess I can DM it to you?

Anyone else know why this is happening?

Not enough info to say for sure, I would suspect the msg.filename has more than just invoice.pdf in it. Show us a debug of message going into http request node.

Yes it does, it has slashes.

Your url varies with every post, very confusing
From your image filename has a / in it using {{ }} will convert it to / . Try using {{{ }}}

The URL is different because there's two different HTTP nodes in the flow.

But {{{ }}} did the trick, thank you very much!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.