Am trying to access the token from ExactOnlineAPI but the documentation recommends to only use x-www-form-urlencoded
. Does Ruby on Rails has this kind of encoding, if so how can i use it.
What is the different between x-www-form-urlencoded
and encode_www_form
params = {
:code => "#{code}",
:redirect_uri => '/auth/exact/callback',
:grant_type => "authorization_code",
:client_id => "{CLIENT_ID}",
:client_secret => "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