user92017: I try to create a raw transaction using the Bitcoin Core RPC through curl.
Python script:
import requests

data = '{"jsonrpc":"2.0","id":"curltext","method":"createrawtransaction", "params": [\'[{"txid":"bffa31485fe5bfbb7e86463ff6c7ee4f084936d54d0471fba7763538e7fd0aa6","vout":0, "sequence":1}]\' \'{"2Mt1FE9NVXP7fRYuPEZBHrFgoCEc4TGb2ZY":0.01}\']}'
print(data)
rawtx = requests.post("http://user:pass@127.0.0.1:18443", data=data).text
print(rawtx)

Output error:
{"jsonrpc":"2.0","id":"curltext","method":"createrawtransaction", "params": ['[{"txid":"bffa31485fe5bfbb7e86463ff6c7ee4f084936d54d0471fba7763538e7fd0aa6","vout":0, "sequence":1}]' '{"2Mt1FE9NVXP7fRYuPEZBHrFgoCEc4TGb2ZY":0.01}']}
{'result': None, 'error': {'code': -32700, 'message': 'Parse error'}, 'id': None}

I've tried escaping in multiple ways, but can't get it working.
Bitcoin CLI command:
bitcoin-cli -testnet createrawtransaction '[{"txid":"bffa31485fe5bfbb7e86463ff6c7ee4f084936d54d0471fba7763538e7fd0aa6","vout":0, "sequence":1}]' '{"2Mt1FE9NVXP7fRYuPEZBHrFgoCEc4TGb2ZY":0.01}'

Expected output (tx hex):
0200000001a60afde7383576a7fb71044dd53649084feec7f63f46867ebbbfe55f4831fabf0000000000010000000140420f000000000017a9140853562996d502a0abe2538657e5bf7bb261b6868700000000


user121614: Your data string isn't correctly formatted JSON. This should be the correct version:
data = '{"jsonrpc":"2.0","id":"curltext","method":"createrawtransaction", "params": [[{"txid":"bffa31485fe5bfbb7e86463ff6c7ee4f084936d54d0471fba7763538e7fd0aa6","vout":0,"sequence":1}],[{"2Mt1FE9NVXP7fRYuPEZBHrFgoCEc4TGb2ZY":0.01}]]}'


92017: <p>I try to create a raw transaction using the Bitcoin Core RPC through curl.</p>
<p>Python script:</p>
<pre><code>import requests

data = '{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;id&quot;:&quot;curltext&quot;,&quot;method&quot;:&quot;createrawtransaction&quot;, &quot;params&quot;: [\'[{&quot;txid&quot;:&quot;bffa31485fe5bfbb7e86463ff6c7ee4f084936d54d0471fba7763538e7fd0aa6&quot;,&quot;vout&quot;:0, &quot;sequence&quot;:1}]\' \'{&quot;2Mt1FE9NVXP7fRYuPEZBHrFgoCEc4TGb2ZY&quot;:0.01}\']}'
print(data)
rawtx = requests.post(&quot;http://user:pass@127.0.0.1:18443&quot;, data=data).text
print(rawtx)
</code></pre>
<p>Output error:</p>
<pre><code>{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;id&quot;:&quot;curltext&quot;,&quot;method&quot;:&quot;createrawtransaction&quot;, &quot;params&quot;: ['[{&quot;txid&quot;:&quot;bffa31485fe5bfbb7e86463ff6c7ee4f084936d54d0471fba7763538e7fd0aa6&quot;,&quot;vout&quot;:0, &quot;sequence&quot;:1}]' '{&quot;2Mt1FE9NVXP7fRYuPEZBHrFgoCEc4TGb2ZY&quot;:0.01}']}
{'result': None, 'error': {'code': -32700, 'message': 'Parse error'}, 'id': None}
</code></pre>
<p>I've tried escaping in multiple ways, but can't get it working.</p>
<p>Bitcoin CLI command:</p>
<pre><code>bitcoin-cli -testnet createrawtransaction '[{&quot;txid&quot;:&quot;bffa31485fe5bfbb7e86463ff6c7ee4f084936d54d0471fba7763538e7fd0aa6&quot;,&quot;vout&quot;:0, &quot;sequence&quot;:1}]' '{&quot;2Mt1FE9NVXP7fRYuPEZBHrFgoCEc4TGb2ZY&quot;:0.01}'
</code></pre>
<p>Expected output (tx hex):</p>
<pre><code>0200000001a60afde7383576a7fb71044dd53649084feec7f63f46867ebbbfe55f4831fabf0000000000010000000140420f000000000017a9140853562996d502a0abe2538657e5bf7bb261b6868700000000
</code></pre>
 121614: <p>Your <code>data</code> string isn't correctly formatted JSON. This should be the correct version:</p>
<pre><code>data = '{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;id&quot;:&quot;curltext&quot;,&quot;method&quot;:&quot;createrawtransaction&quot;, &quot;params&quot;: [[{&quot;txid&quot;:&quot;bffa31485fe5bfbb7e86463ff6c7ee4f084936d54d0471fba7763538e7fd0aa6&quot;,&quot;vout&quot;:0,&quot;sequence&quot;:1}],[{&quot;2Mt1FE9NVXP7fRYuPEZBHrFgoCEc4TGb2ZY&quot;:0.01}]]}'
</code></pre>
