Skip to content

Instantly share code, notes, and snippets.

@agungsetiawan
Created March 31, 2020 05:42
Show Gist options
  • Save agungsetiawan/e2acf3dd1f033b88abe0b8e607e893f2 to your computer and use it in GitHub Desktop.
Save agungsetiawan/e2acf3dd1f033b88abe0b8e607e893f2 to your computer and use it in GitHub Desktop.
def self.internal_api(*args)
self.faraday(*args) do |f|
f.headers['Content-Type'] = 'application/json'
f.headers['InternalAPIPassword'] = ENV['INTERNAL_API_PASSWORD']
f.headers['UserRole'] = ENV['USER_ROLE']
f.headers['UserCode'] = ENV['USER_CODE']
f.options.open_timeout = 10
f.options.timeout = 20
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment