POST request to Tendermint yields empty string
Hi!
I have a Tendermint 0.33.9-1baf670c running on my machine. I can contact it through GET, as follows:
curl --request GET localhost:26657/genesis
and I see the resulting JSON on the screen, correctly. However, the same call, in POST version, prints the empty string (and no error):
curl -H “Content-Type: application/json; utf-8” -H “Accept: application/json” --request POST --data ‘{“method”:“genesis”}’ localhost:26657
What am I doing wrong?
Thanks!
Hi!
Please get in touch with the Core Devs on discord!
Join the Cosmos Community Discord Server!
Check out the Cosmos Community community on Discord - hang out with 7,163 other members and enjoy free voice and text chat.
curl -H “Content-Type: application/json; utf-8” -H “Accept: application/json” --request POST --data ‘{“method”:“genesis”}’ localhost:2665
You need to send across an empty parameters array and an id.
Try:
curl -H "Content-Type: application/json; utf-8" -H "Accept: application/json" --request POST --data '{"method":"genesis", "params": [], "id": 1}' localhost:26657
Thank you David! This solved my issue.