How to capture HTTP posts

#1

I am trying to capture and eventually store in MySQL, all HTTP posts sent to my server.
The sender is a public Minecraft server with a computercraft mod that has a Lua HTTP API.
A colleague was able to make a Python program capturing and storing these on my server but now I want to handle them via Node-RED.

  1. if http://mysite:1880 is running Node-RED, what URL does the Post have to use?
  2. How would I go on about capturing these? Note, there can be multiple every second.
    I already have experience with MQTT -> JSON2JsObject -> MySQL in Node-RED, I just have zero experience with HTTP messages.
0 Likes

#2

Take a look at the http nodes (not the http request node) As you configure the node you select the endpoint name but it would be http://mysite:1880/endpointname

If you are using the http-in node your flow has to have a route to the http-out node so that a message is sent back to whatever requested the “page”

Take a look at the http endpoints example in the cookbook https://cookbook.nodered.org

0 Likes