Why do I get a malformed JSON in request body in this cURL call? : <p>I have been trying to call the CloudFlare API v4, using an example provided in their own documentation.</p>

<p>This is the code of the example</p>

<pre><code>curl -X PUT "https://api.cloudflare.com/client/v4/zones/023e105f4ecef8ad9ca31a8372d0c353/dns_records/372e67954025e0ba6aaa6d586b9e0b59" \ -H "X-Auth-Email: user@example.com" \ -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41" \ -H "Content-Type: application/json" \ --data '{"id":"372e67954025e0ba6aaa6d586b9e0b59","type":"A","name":"example.com","content":"1.2.3.4","proxiable":true,"proxied":false,"ttl":120,"locked":false,"zone_id":"023e105f4ecef8ad9ca31a8372d0c353","zone_name":"example.com","created_on":"2014-01-01T05:20:00.12345Z","modified_on":"2014-01-01T05:20:00.12345Z","data":{}}'
</code></pre>

<p>Which can also be found at
<a href="https://api.cloudflare.com/#dns-records-for-a-zone-dns-record-details" rel="noreferrer">Update DNS Records</a></p>

<p>Using Windows cmd.exe to run this command, i need to make it single line first, so i removed the "\" and reformatted it (twice) making sure I altered no part in the process.</p>

<p>This is the same code in one line :</p>

<pre><code>curl -X PUT "https://api.cloudflare.com/client/v4/zones/023e105f4ecef8ad9ca31a8372d0c353/dns_records/372e67954025e0ba6aaa6d586b9e0b59" -H "X-Auth-Email: user@example.com" -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41" -H "Content-Type: application/json" --data '{"id":"372e67954025e0ba6aaa6d586b9e0b59","type":"A","name":"example.com","content":"1.2.3.4","proxiable":true,"proxied":false,"ttl":120,"locked":false,"zone_id":"023e105f4ecef8ad9ca31a8372d0c353","zone_name":"example.com","created_on":"2014-01-01T05:20:00.12345Z","modified_on":"2014-01-01T05:20:00.12345Z","data":{}}'
</code></pre>

<p>When i run this single-liner in cmd, it works but i get a malformed JSON in request body, however, a visual check, formatting on notepad++ and a run through the JSON validator are all positive, this JSON (copied from the CloudFlare documentation) is not malformed.</p>

<p>Error Message</p>

<pre><code>{"success":false,"errors":[{"code":6007,"message":"Malformed JSON in request body"}],"messages":[],"result":null}
</code></pre>

<p>Googling this error message or the error code gives me nothing and this same command works on a pc running linux of my boss.</p>

<p>Can someone tell me if this is a known bug, if the JSON really is malformed or if something else comes to mind ?</p>

<p>Thank you</p>
