Skip to main content
added 6 characters in body
Source Link
user103136
user103136

Copied the body part from https://bitcoincore.org/en/doc/0.21.0/rpc/util/createmultisig/https://bitcoincore.org/en/doc/0.21.0/rpc/wallet/addmultisigaddress/ and replaced addresses with 2 new addresses (regtest):

POST / HTTP/1.1
Host: localhost:18333
Authorization: Basic YmFzZTY0dXNlcjpiYXNlNjRwYXNz
Content-Type: text/plain
Content-Length: 186

{"jsonrpc": "1.0", "id": "curltest", "method": "addmultisigaddress", "params": [2, "[\"bcrt1qvtp07jfnk5wcslr6xjmntnkxchzt7j2rzswnqn\",\"bcrt1qzwpuwrykaacx7057tnafyrd4nnfecc602gptca\"]"]}

Error:

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

Copied the body part from https://bitcoincore.org/en/doc/0.21.0/rpc/util/createmultisig/ and replaced addresses with 2 new addresses (regtest):

POST / HTTP/1.1
Host: localhost:18333
Authorization: Basic YmFzZTY0dXNlcjpiYXNlNjRwYXNz
Content-Type: text/plain
Content-Length: 186

{"jsonrpc": "1.0", "id": "curltest", "method": "addmultisigaddress", "params": [2, "[\"bcrt1qvtp07jfnk5wcslr6xjmntnkxchzt7j2rzswnqn\",\"bcrt1qzwpuwrykaacx7057tnafyrd4nnfecc602gptca\"]"]}

Error:

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

Copied the body part from https://bitcoincore.org/en/doc/0.21.0/rpc/wallet/addmultisigaddress/ and replaced addresses with 2 new addresses (regtest):

POST / HTTP/1.1
Host: localhost:18333
Authorization: Basic YmFzZTY0dXNlcjpiYXNlNjRwYXNz
Content-Type: text/plain
Content-Length: 186

{"jsonrpc": "1.0", "id": "curltest", "method": "addmultisigaddress", "params": [2, "[\"bcrt1qvtp07jfnk5wcslr6xjmntnkxchzt7j2rzswnqn\",\"bcrt1qzwpuwrykaacx7057tnafyrd4nnfecc602gptca\"]"]}

Error:

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

`addmultisigaddress` syntax for POST request

Copied the body part from https://bitcoincore.org/en/doc/0.21.0/rpc/util/createmultisig/ and replaced addresses with 2 new addresses (regtest):

POST / HTTP/1.1
Host: localhost:18333
Authorization: Basic YmFzZTY0dXNlcjpiYXNlNjRwYXNz
Content-Type: text/plain
Content-Length: 186

{"jsonrpc": "1.0", "id": "curltest", "method": "addmultisigaddress", "params": [2, "[\"bcrt1qvtp07jfnk5wcslr6xjmntnkxchzt7j2rzswnqn\",\"bcrt1qzwpuwrykaacx7057tnafyrd4nnfecc602gptca\"]"]}

Error:

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