Sha256: 1ea5402afba2c94ba1bad14758b1c317a6df429aa26248acacc4762d8d71b4af

Contents?: true

Size: 522 Bytes

Versions: 6

Compression:

Stored size: 522 Bytes

Contents

module Targetdata
  module Api
    module Requester
      def get_person
        response = HTTP.headers(cpf_headers).post(Targetdata::BASE_URL + '/PF/CPF', body: [@cpf].to_json)
        raise Targetdata::Errors::Unauthorized if response.status.unauthorized?
        
        response
      end

      private
        def cpf_headers
          {
            'Content-Type':'application/json',
            'Accept':'application/json',
            'Authorization': "Bearer #{token}"
          }
        end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
targetdata-0.4.1 lib/targetdata/api/requester.rb
targetdata-0.4.0 lib/targetdata/api/requester.rb
targetdata-0.3.1 lib/targetdata/api/requester.rb
targetdata-0.3.0 lib/targetdata/api/requester.rb
targetdata-0.2.1 lib/targetdata/api/requester.rb
targetdata-0.2.0 lib/targetdata/api/requester.rb