title: Ruby https POST with headers
body: <p>How can I make a Https post with a header in Ruby with a json?</p>
  
  <p>I have tried:</p>
  
  <pre><code>uri = URI.parse("https://...")
      https = Net::HTTP.new(uri.host,uri.port)
      req = Net::HTTP::Post.new(uri.path)
      req['foo'] = bar
      res = https.request(req)
  puts res.body
  </code></pre>