Sha256: 8faecacda6a832ca82c2f28a33c11af5201ecb9f86c565d4ce738aa92ce08007

Contents?: true

Size: 424 Bytes

Versions: 5

Compression:

Stored size: 424 Bytes

Contents

require 'rest-client'
require 'multi_json'

module FcEnrich
  class HttpClient
    def post(path, payload_hash)
      response = RestClient.post("https://api.fullcontact.com#{path}",
                                 MultiJson.encode(payload_hash),
                                 authorization: "Bearer #{FcEnrich.api_key}")
      MultiJson.decode(response.body)
    rescue RestClient::NotFound
      nil
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fc_enrich-0.3.1 lib/fc_enrich/http_client.rb
fc_enrich-0.3.0 lib/fc_enrich/http_client.rb
fc_enrich-0.2.1 lib/fc_enrich/http_client.rb
fc_enrich-0.2.0 lib/fc_enrich/http_client.rb
fc_enrich-0.1.1 lib/fc_enrich/http_client.rb