How to see/debug the POST body in Telegraf?

Hello, I’m trying to setup a telegraf instance to query a piece of equipment called Mastertroinc that performs automated water testing for aquariums. I was able to figure out part of their API and the call that I need to perform is a POST request with a plain JSON body. (if the body contains anything else than JSON, the equipment returns an error 500).
I setup my telegraf.conf to perform a post and added the required JSON to the body parameter but when I execute it, the response I see in the log is
[inputs.http] Error in plugin: [url=http://192.168.1.69/api/action_list]: received status code 500 (Internal Server Error), expected any value out of [200] stdout
I’m not sure if the POST request is being sent with no body or if my JSON code in the body is misconstructed.

Does anyone know how can I see the POST query that telegraf is sending or any other way to debug this issue?
Thanks in advance.

For reference, here are the relevant parameters in my telegraf.conf file
[[inputs.http]]
urls = [“http://192.168.1.69/api/action_list”]
method = “POST”
body = “{“action”:“HISTORY”,“data”:{“range”:“1440”},“type”:“read”}”

Hello @miguel,
Have you tried included debug=true in the agent portion of your config?
Have you tried running telegraf with the --test flag?

Hi Anai,
Thanks for the reply, yeah I’m running with debug=true in the configuration file but not with the --test flag. I’ll find out how to add it to my Synology Docker container and try that out!
Thanks