title: Google oauth2 error "Required parameter is missing: response_type" (Ruby)
body: <p>My first Ruby adventure is to try and get oauth2 token for web service app from google. There are many questions and answers on this topic, but none that resolved my issue.
  I registered a dummy web service with google and am trying to get authorization code (even before trying to get a token). Doesn't matter what mandatory parameter I omit (e.g. client_id) when accessing <code>https://accounts.google.com/o/oauth2/auth</code> I always get 400 error with message 'Required parameter is missing: response_type'.
  Here is the code snippet, following Google's guidelines in <a href="https://developers.google.com/accounts/docs/OAuth2WebServer#formingtheurl" rel="nofollow">https://developers.google.com/accounts/docs/OAuth2WebServer#formingtheurl</a>:</p>
  
  <pre><code>    get '/' do
          requestGoogleAccessToken(102030, "http://localhost:4567/oauth2callback/")
      end
  
      def requestGoogleAccessToken(auth_code, redirect_uri)
          googleAuthHost = 'https://accounts.google.com/o/oauth2/auth'
          googleClientID = "XXXXXXXXXXX.apps.googleusercontent.com"
          scope = 'https://www.googleapis.com/auth/calendar'
  
          url="#{googleAuthHost}?scope=profile&amp;redirect_uri=#{CGI.escape(redirect_uri)}&amp;client_id=#{googleClientID}&amp;response_type=code"
          uri=URI.parse(url)
  
          https=Net::HTTP.new(uri.host,uri.port)
          https.use_ssl=true
          req=Net::HTTP::Post.new(uri.path)
          res=https.request(req)
          puts "\n  res:   ", res       
          puts "\n  response body: ", res.body
      end
  </code></pre>
  
  <p>Thanks in advance for your help.</p>