Class: Exchanger::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/exchanger/client.rb

Overview

SOAP Client for Exhange Web Services

Instance Method Summary collapse

Constructor Details

#initializeClient

Returns a new instance of Client.


6
7
8
9
10
11
# File 'lib/exchanger/client.rb', line 6

def initialize
  @client = HTTPClient.new
  @client.debug_dev = STDERR if debug
  @client.set_auth nil, username, password if username
  @client.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE if insecure_ssl
end

Instance Method Details

#request(post_body, headers) ⇒ Object

Does the actual HTTP level interaction.


14
15
16
17
# File 'lib/exchanger/client.rb', line 14

def request(post_body, headers)
  response = @client.post(endpoint, post_body, headers)
  return { :status => response.status, :body => response.content, :content_type => response.contenttype }
end