title: invalid_request response when curl to google
body: <p>I am writing following code to get authorization token. </p>
  
  <p>assigning authorization to code variable</p>
  
  <pre><code>$code =  $this-&gt;request-&gt;query['code'];
  </code></pre>
  
  <p>i have deleted my client secret to post question.</p>
  
  <pre><code>$clientSecret = "";
  </code></pre>
  
  <p>initializing curl</p>
  
  <pre><code>        $ch = curl_init();
          $header[]         = "Content-Type: application/x-www-form-urlencoded";
  
          curl_setopt($ch, CURLOPT_HTTPHEADER,     $header);
          curl_setopt($ch, CURLOPT_POST,        true);
          curl_setopt($ch, CURLOPT_POSTFIELDS, urlencode("code=".$code."&amp;
                  client_id=289710071999.apps.googleusercontent.com&amp;
                  client_secret=".$clientSecret."&amp;
                  redirect_uri=http://budzzflorist.localhost.com/users/google&amp;
                  grant_type=authorization_code"));
          curl_setopt($ch, CURLOPT_URL, "https://accounts.google.com/o/oauth2/token");
          curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
          $request_result = curl_exec($ch);
          print_r(curl_getinfo($ch));
          echo "\n\ncURL error number:" .curl_errno($ch); // print error info
          echo "\n\ncURL error:" . curl_error($ch);
          var_dump( json_decode($request_result,true));
  </code></pre>