3

When I try to get table using

curl --request POST \                                                                                               
  --url http://bp.cryptolions.io:8888/v1/chain/get_table_rows \
  --data '{"table":"global","scope":"eosio","code":"eosio","limit":10}'

I get the binary format:

{"rows":["0000100000000000e8030000000008000c000000f40100001400000064000000400d0300e8030000f049020064000000100e00005802000080533b0000100000040006000000000010000000a1deb0e00d00000072e292390f0000000ff59b4560b5958914700500a447800e00000000aa56e30100000000ff430100865ce6a59102000000e15fd7136f0500150072bf769f2819dd4300000000"],"more":false}

But when I use

/opt/eosio/bin/cleos -u http://bp.cryptolions.io:8888 get table eosio eosio rammarket

I get expected result as JSON

{
  "rows": [{
      "supply": "10000000000.0000 RAMCORE",
      "base": {
        "balance": "8895932725 RAM",
        "weight": "0.50000000000000000"
      },
      "quote": {
        "balance": "7724878.7130 EOS",
        "weight": "0.50000000000000000"
      }
    }
  ],
  "more": false
}

Wondering why HTTP API produces such results?

1 Answer 1

6

The output was in binary format. If you need the output as json then add "json":true in the data as shown in the command below

curl --request POST 
--url http://bp.cryptolions.io:8888/v1/chain/get_table_rows 
--data '{"table":"global","scope":"eosio","code":"eosio","limit":10,"json":true}'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.