title: Stripe payment returns 400 code in node js but not through insomnia
body: <p>I'm trying to perform small integration of Stripe without npm, so below is my helper snippet:</p>
  <pre><code>const https = require('https')
  const config = require('./config')
  
  const stripe = {}
  
  stripe.makePayment = function(callback) {
  
      // configure the request payload
      const payload = {
          &quot;amount&quot; : 50,
          &quot;currency&quot; : &quot;usd&quot;,
          &quot;source&quot; : &quot;tok_visa&quot;,
          &quot;description&quot; : &quot;Payment from NODE API&quot;
      }
  
      // Configure the request details
      const requestDetails = {
          'protocol': 'https:',
          'hostname': 'api.stripe.com',
          'method': 'POST',
          'path': '/v1/charges',
          'headers': {
              'Contenty-Type': 'application/w-www-form-urlencoded',
              'Authorization': 'Bearer ' + config.stripe.key
          }
      }
  
      // Instantiate the request object
      var req = https.request(requestDetails, function(res){
          // Grab the status of the sent request
          var status = res.statusCode
          // Callback successfully if the request went through
          if(status == 200 || status == 201){
              callback(false)
          }else {
              callback(&quot;Status code returned was&quot;+status)
          }
      })
  
      // Bind to the error event so it doesn't get thrown
      req.on('error', function(e){
          callback(e)
      })
  
      // Add the payload
      req.write(JSON.stringify(payload))
  
      // End the request
      req.end()
  
  }
  
  module.exports = stripe
  </code></pre>
  <p>I call the make payment function inside index.js like this:</p>
  <pre><code>const stripe = require('./lib/stripe')
  
  stripe.makePayment(function(err){
      console.log(err)
  })
  </code></pre>
  <p>When I run the index file, I get a 400 response.</p>
  <p>NOTE: My post request is successful when I try on Insomnia. I use Bearer api_token as authorization, and form URL encoded content type.</p>
  <p>Stripe documentation link <a href="https://stripe.com/docs/api/charges/create" rel="nofollow noreferrer">here</a></p>
  <p>What can possibly be wrong with my POST request?</p>
  <p>My full index file can be found here <a href="https://jsbin.com/pesujezihi/1/edit?js,output" rel="nofollow noreferrer">enter link description here</a></p>