title: How set Header with Net::Http for Goo.gl Shorten service?
body: <p><a href="http://code.google.com/intl/fr-FR/apis/urlshortener/v1/getting_started.html#shorten" rel="nofollow noreferrer">Like describe in API Goo.gl</a> </p>
  
  <p>Manualy curl work perfectly :</p>
  
  <pre><code>curl https://www.googleapis.com/urlshortener/v1/url \
      -H 'Content-Type: application/json' \
      -d '{"longUrl": "http://www.rubyinside.com/"}'
  </code></pre>
  
  <p>Bu when i try to make this in Net::Http :</p>
  
  <pre><code>require "net/https"
  require "uri"
  uri = URI.parse("https://www.googleapis.com/urlshortener/v1/url")
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
  request = Net::HTTP::Post.new(uri.path)
  request["Content-Type"] = "application/json"
  request.set_form_data({"longUrl" =&gt; "http://www.rubyinside.com/"})
  response = http.request(request)
  puts response.body
  </code></pre>
  
  <p>But fail with the response :</p>
  
  <pre><code>{
   "error": {
    "errors": [
     {
      "domain": "global",
      "reason": "parseError",
      "message": "This API does not support parsing form-encoded input."
     }
    ],
    "code": 400,
    "message": "This API does not support parsing form-encoded input."
   }
  }
   =&gt; nil
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/6566394/problems-using-the-goo-gl-api-from-google-apps-script">I see an another issue but seem does not work</a>  </p>
  
  <p><a href="http://www.appelsiini.net/2011/using-googl-with-httparty" rel="nofollow noreferrer">This httparty sample code work but i want use net_http</a></p>