Using HTTP Request to pull data from FANUC Web Sever

I have been attempting to make an HTTP Request to a FANUC Robots webserver such that I can pull the applicable data from the web server and upload it to MQTT.

When making the GET HTTP Request from Postman the applicable data is retrieved however when making the Request from the HTTP Request Node in Node-RED I cannot seem to get the same result. I have quadruple checked all applicable headers and ensured the URL is set correctly.

When invoking a curl myurl -I command from the command window in order to retrieve the headers I receive a 'HTTP/1.0 503 Service Unavailable error' which makes me believe the Server is busy and/or does not allow this capability. Although, Postman makes the request without error.

When attempting to make the request in Node-RED with the same Headers set in Postman I receive the following error message: "Request Error: Parse Error: Invalid header value char : myurl" additionally below the HTTP Request Node it reads "HPE_INVALID_HEADER_TOKEN". I have attempted to encode the URL using encodeURIComponent(myurl) however it gives me "TypeError: Invalid URL".

If anyone could give any insight or suggestions on this matter it would be greatly appreciated.

Mentioned many times on the forum.

In short, your old robots are returning malformed response (According to the http spec)

Luckily, this is handled in latest Node-RED beta - you get an option to disable strict parsing that really REALLY works

image

If you are in a position to test this and feedback, we would be most appreciative.

Hello Steve,

Thank you for the quick response. The fix does indeed work in the the latest Node-RED beta v3.1.0-beta.4.

When checking off "Disable strict HTTP parsing" I was able to retrieve my desired data.

To note: I am running Node.js version: v18.16.0

1 Like

Thanks for the feedback. Adds confidence to imminent v3.1 release.

1 Like

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