Sha256: cb72df2cdf615fe7e72475a95b39cdf39960dbe6a8832fb50f078cfcf688919c

Contents?: true

Size: 636 Bytes

Versions: 1

Compression:

Stored size: 636 Bytes

Contents

# frozen_string_literal: true

module Quickmail
  class Authentication

    class << self
      def oauth(payload = {})
        RestClient::Request.new({
                                  method: :post,
                                  url: Quickmail.api_base + 'token',
                                  payload: payload,
                                  headers: {content_type: "application/x-www-form-urlencoded"}
                                }).execute do |response, request, result|
          str_response = response.to_str
          str_response.blank? ? '' : JSON.parse(str_response)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
quickmail-0.22.0 lib/quickmail/authentication.rb