Unable to retrieve token bearer, error 170 Missing required parameter: grant_type



I’m trying to write a small program in node.js to get going with working with the Twitter API, however, I’m running into an error, and I have no clue why.

Everything that’s supposed to be there is there, to the best of my knowledge. It doesn’t look like anything’s missing. It doesn’t look like anything’s broken. But when it gets back, it’s broken.

Code is here:
var request = require(‘request’);

var options = {
  url: 'https://api.twitter.com/oauth2/token',
  method: 'POST',
  headers: {
    "Authorization": "Basic " + new Buffer("[key]:[secretkey]").toString('base64'),
  body: "grant_type=client_credentials"

request.post(options, function(error, response, body){


Simple fix: contentType was supposed to be Content-Type.