Hi, I am using node-red to get some data from a REST-like API endpoint.
The general endpoint is like this:
some.domain.here/controller/value/signalname
filling in the values for the controller, value, and the signal has worked like expected until one of the signals has a / in the name. This predictably gives 404 as it is parsed as a part of the URL.
I tested in postman and found that when I replace the / in my signal with %2F it works. Great now I have a fix, but it does not work in node-red.
In node-red the HTTP request URL seem to be "helpful" and encodes my URL for me, and that makes my URL: some.domain.here/controller/value/signal%2Fname
into:
URL: some.domain.here/controller/value/signal%252Fname (the problem here being % is encoded for me into %25)
Is there a way to stop the http-request from doing this, or is there an alternative module I could use?
Or am I stuck having to write the http-request myself in a function block?
I have created an HTTP In flow that listens for request on /test/* - so anything starting with /test/. It logs to Debug the value of msg.req.originalUrl - the actual url being sent in the request.
In a separate flow, if I enter http://localhost:1880/test/foo%2Fbar into the url field of an HTTP Request node, when I trigger it, I see the request arrive on the path /test/foo%2Fbar - so no modification appears to have happened.
I've tried a number of variations of this, and I can't get it to do the double encoding you're seeing. So there must be some aspect to this I'm missing.
Can you share an example flow that demonstrates the issue?
Also, can you confirm what version of Node-RED you're using?