# File lib/oauth2/strategy/web_server.rb, line 14
      def get_access_token(code, options={})
        response = @client.request(:get, @client.access_token_url, access_token_params(code, options))

        if response.is_a? Hash
          params = response
        else
          params = MultiJson.decode(response) rescue nil
          # the ActiveSupport JSON parser won't cause an exception when
          # given a formencoded string, so make sure that it was
          # actually parsed in an Hash. This covers even the case where
          # it caused an exception since it'll still be nil.
          params = Rack::Utils.parse_query(response) unless params.is_a? Hash
        end

        access = params.delete('access_token')
        refresh = params.delete('refresh_token')
        # params['expires'] is only for Facebook
        expires_in = params.delete('expires_in') || params.delete('expires')
        OAuth2::AccessToken.new(@client, access, refresh, expires_in, params)
      end