title: Editing Gist with cURL: "Problems parsing JSON",
body: <pre><code>#!/bin/bash
  
  curl -v \
  
    --request PATCH \
    --data "$(
      printf '{"files": {"somefile.json": {"content": " {"field": "value"} "}}}' \
      )" \
    --user x:x \
    https://api.github.com/gists/x
  </code></pre>
  
  <p>Tried adding --header "Content-Type: application/json", no luck.</p>
  
  <p>I'm using this because the content is actually a command output but right now I'm testing the basics because this is not workig.</p>
  
  <p>I believe is somethig related to double quote escaping in bash, tried for a couple of hours with no luck. This is a nightmare.</p>
  
  <p>Any tip is welcomed. Thanks.</p>