You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: app_only_oauth_client.rb
    path of file: ./repos/twurl/lib/twurl
    
    the code of the file until where you have to start completion: require 'base64'
require_relative 'oauth_client'

module Twurl
  class AppOnlyOA
    
    def fetch_oauth2_token
      request = Net::HTTP::Post.new('/oauth2/token')
      request.body = URI.encode_www_form(request_data)
      request['user-agent'] = user_agent
      request['authorization'] = "Basic #{Base64.strict_encode64("#{consumer_key}:#{consumer_secret}")}"
      response = http_client.request(request).body
      JSON.parse(response,:symbolize_names => true)
    end