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
12
# 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
  @client.ssl_config.ssl_version = ssl_version if ssl_version
end

Instance Method Details

#request(post_body, headers) ⇒ Object

Does the actual HTTP level interaction.



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

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