title: Curl -d vs --data-binary
body: <p>Using this [<a href="https://github.com/prometheus/pushgateway][1]" rel="noreferrer">https://github.com/prometheus/pushgateway][1]</a> we are trying to push one metric to prometheus.  It seems to require the data in a very specific format.</p>
  
  <p>It works fine when doing their example curl of </p>
  
  <pre><code>echo "some_metric 3.14" | curl --data-binary @- http://pushgateway.example.org:9091/metrics/job/some_job
  </code></pre>
  
  <p>Yet doing a curl with -d option fails as missing end of line/file</p>
  
  <pre><code>curl -d 'some_metric 3.15\n' http://pushgateway.example.org:9091/metrics/job/some_job
  </code></pre>
  
  <p>I'm trying to understand the difference in behaviour since I believe both are doing POST commands and I need to replicate this --data-binary option in node.js via "request.post" method but I seem to only be able to replicate the curl -d option which doesn't work.</p>
  
  <p>Any suggestions on hints on what the difference is between -d and --data-binary and to do the equivalent to --data-binary from within node.js?</p>