[Docs] Correct `sendmany` curl example #12077

pull l2a5b1 wants to merge 1 commits into bitcoin:master from l2a5b1:patch/12067/fixes-sendmany-curl-example changing 1 files +1 −1
  1. l2a5b1 commented at 8:05 PM on January 2, 2018: contributor

    The example curl command in the sendmany RPC help results in an error:

    {"result":null,"error":{"code":-1,"message":"JSON value is not an object as expected"},"id":"curltest"}
    

    because - as reported in #12067 - the second element in the params array should be a JSON object.

    This PR removes the escaped backslash and quote characters that serialize the JSON object to a string and make it a plain JSON object:

    curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendmany", "params": ["", {"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX":0.01,"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz":0.02}, 6, "testing"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
    

    which (when executed with valid addresses) yields the expected result:

    {"result":"c446213f06ee4489660ed5dc47d65daca27345d0b5fc5bd344ebca78b2d87356","error":null,"id":"curltest"}
    
  2. Fixes issue #12067 `sendmany` curl example is wrong.
    This commit removes the escaped backslash and quote characters from the keys in the JSON object to make it a plain JSON object.
    0d663f8197
  3. fanquake added the label Docs on Jan 2, 2018
  4. fanquake added the label RPC/REST/ZMQ on Jan 2, 2018
  5. meshcollider commented at 10:43 PM on January 2, 2018: contributor

    Concept ACK, thanks for helping out :)

    It'd be better to move the "Fixes #12067" text into the body of the PR not the title or the commit message though

  6. fanquake renamed this:
    Fixes issue #12067 `sendmany` curl example is wrong.
    [Docs] Correct `sendmany` curl example
    on Jan 3, 2018
  7. laanwj commented at 9:17 AM on January 3, 2018: member

    tested ACK 0d663f8, looks good to me, IMO the commit message is clear enough.

  8. laanwj merged this on Jan 3, 2018
  9. laanwj closed this on Jan 3, 2018

  10. laanwj referenced this in commit c04cb48df9 on Jan 3, 2018
  11. l2a5b1 deleted the branch on Jan 4, 2018
  12. jasonbcox referenced this in commit e85b7bfe5b on Oct 29, 2020
  13. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me