It's trivially simple to spin up an entire web server in Python which can handle GETs, POSTs and all the rest. You'd have access to the complete request object, so you could pick out and log whatever you want from that.
There's a nice-enough example here: https://pythonbasics.org/webserver/
Simon
On 30/11/2021 12:26, Mark Rogers wrote:
Background: I have some hardware which can make a REST request when an input changes. I'm trying to send that request to a ThingsBoard server but it's generating a mostly useless error (it indicates that the JSON won't decode but won't tell me what's being received).
If I direct it to a PHP script on a different server which just logs the POST data, everything looks OK and if I copy+past that same data into a commandline curl request to the TB server it works fine. So whatever is failing is more subtle.
So what I want to do is set up a temporary server-side script that will log everything that is received in an HTTP request (URL, POST/GET data, headers, etc). I can then point the hardware at it, and then also the working curl commandline, and see what is different.
Any suggestions as to how to do this? Or how better to describe what I' trying to do so I can Google it more effectively? -- Mark Rogers // More Solutions Ltd (Peterborough Office) // 0344 251 1450 Registered in England (0456 0902) 21 Drakes Mews, Milton Keynes, MK8 0ER
main@lists.alug.org.uk http://www.alug.org.uk/ https://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!