title: send email using gmail api Error: This API does not support parsing form-encoded input
body: <p>I'm trying to send email using gmail-api, I'm reading data from user and 
  converted it to <code>base64url</code> string</p>
  
  <p>I'm getting the raw value and when I try to send the mail using post request</p>
  
  <pre><code> var ss=new Buffer(message).toString('base64')
   var rawdata = ss.replace(/\//g, '_').replace(/\+/g, '-');
   var options={"access_token":google.accessToken,'raw':rawdata};
   var res=HTTP.post('https://www.googleapis.com/gmail/v1/users/me/messages/send',{params: options});
  </code></pre>
  
  <p>It is throwing error </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."  } } 
  </code></pre>
  
  <p>I'm sending following params</p>
  
  <pre><code>var message = 'From: Me &lt;ff@gmail.com&gt;\r\n' +
          'To: Me &lt;ss@gmail.com&gt;\r\n' +
          'Subject: Hello\r\n'+
          'Mime-Version: 1.0\r\n'+
          'Content-Type: text/html; charset=utf-8\r\n' +
          'Content-Transfer-Encoding: quoted-printable\r\n\r\n' +
          '&lt;html&gt;&lt;body&gt;' +
          '&lt;h1&gt;World&lt;/h1&gt;' +
          '&lt;/body&gt;&lt;/html&gt;';
  </code></pre>
  
  <p>I'm using valid emails in my app,</p>
  
  <p><strong>Important thing is</strong> when I paste the generated <code>raw</code> in gmail-api <a href="https://developers.google.com/gmail/api/v1/reference/users/messages/send#try-it" rel="nofollow">explorer</a>,</p>
  
  <p>It is working fine and the email is sending, but when I send post request with the same raw it is throwing error.</p>
  
  <p><strong>EDIT</strong>: accesstokens are also fine, they are working for other queries.</p>
  
  <p>What is the error in my code?I suppose the error is with headers.</p>
  
  <p>Any help appreciated.</p>