title: How to use x-www-form-urlencoded in rails
body: <p>Am trying to access the token from <a href="https://developers.exactonline.com/#OAuth_Tutorial.html%3FTocPath%3DAuthentication%7C_____2" rel="noreferrer">ExactOnlineAPI</a> but the documentation recommends to only use  <code>x-www-form-urlencoded</code>. Does Ruby on Rails has this kind of encoding, if so how can i use it.</p>
  
  <p>What is the different between <code>x-www-form-urlencoded</code> and <code>encode_www_form</code></p>
  
  <pre><code> params =  {
               :code =&gt; "#{code}",
               :redirect_uri =&gt; '/auth/exact/callback',
               :grant_type   =&gt; "authorization_code",
               :client_id   =&gt; "{CLIENT_ID}",
               :client_secret =&gt; "CLIENT_SECRET"
             }
  uri = URI('https://start.exactonline.nl/api/oauth2/token')
  #
  uri.query = URI.encode_www_form(params)
  res = Net::HTTP.get_response(uri)
  puts "Access Token: "+res.body
  </code></pre>