Skip to content
Cosmopediaby Unity Nodes
DiscussionsTendermintPOST request to Tendermint yields empty stringForum ↗

POST request to Tendermint yields empty string

Tendermint4 posts748 views1 likesLast activity Jul 2021
FA
fausto.spotoOP
Apr 2021

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!

CA
catdotfish
Apr 2021

Hi!
Please get in touch with the Core Devs on discord!

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.

CS
csknk
Jul 2021
fausto.spoto:

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
FA
fausto.spoto
Jul 2021 1

Thank you David! This solved my issue.

← Back to Discussions