Hi there
I'm trying to get some data from API endpoint that is not well documented but it has been reverse engineered. I can easily make proper call using any known tool as curl or browser inspector.
However, when I'm recreating such call in Node-RED, I get err500 from the server. I assume that required header (content-type
) is not reaching that endpoint as it behaves in the same way when I miss it using tools mentioned above.
Below is a simple flow for testing that. I should get timestamp, instead I get err500. Now the main question - is there a way to actually see what is being sent to that URL? I assume node.js is calling it in the background that's why I can't see that request in the browser inspector. I'm googling this for the last 3 days and decided to ask the community.
Summary for the API:
POST http://www.peka.poznan.pl/vm/method.vm?ts=666
with data: {method: 'getServerTime', p0: '{}'}
return: timestamp
Any hint on how to make this flow getting the proper response would be great.
Thanks
[{"id":"980a3a92.b87cc8","type":"inject","z":"90e2ad1d.c627e","name":"Function data","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":190,"y":100,"wires":[["afd450eb.bfe738"]]},{"id":"10c8d06a.412198","type":"http request","z":"90e2ad1d.c627e","name":"Query PEKA","method":"POST","ret":"txt","url":"http://www.peka.poznan.pl/vm/method.vm?ts={{timestamp}}","tls":"","x":610,"y":100,"wires":[["ccf2244b.1ee938"]]},{"id":"afd450eb.bfe738","type":"function","z":"90e2ad1d.c627e","name":"set payload and headers","func":"msg.headers = {'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'};\nmsg.timestamp = new Date().getTime();\nmsg.payload = {\n method: 'getServerTime',\n p0: {}\n};\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":100,"wires":[["10c8d06a.412198"]]},{"id":"ccf2244b.1ee938","type":"debug","z":"90e2ad1d.c627e","name":"output","active":true,"console":"true","complete":"true","x":780,"y":100,"wires":[]}]