Class: UnionPay::Core::HttpClient
- Inherits:
-
Object
- Object
- UnionPay::Core::HttpClient
- Includes:
- Logger
- Defined in:
- lib/union-pay/core/http_client.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(url, params, config) ⇒ HttpClient
constructor
A new instance of HttpClient.
- #post ⇒ Object
Methods included from Logger
Constructor Details
#initialize(url, params, config) ⇒ HttpClient
Returns a new instance of HttpClient.
9 10 11 12 13 |
# File 'lib/union-pay/core/http_client.rb', line 9 def initialize(url, params, config) @uri = URI(url) @params = params @config = config end |
Class Method Details
.post(url, params, config) ⇒ Object
21 22 23 |
# File 'lib/union-pay/core/http_client.rb', line 21 def self.post(url, params, config) self.new(url, params, config).post end |
Instance Method Details
#post ⇒ Object
15 16 17 18 19 |
# File 'lib/union-pay/core/http_client.rb', line 15 def post httpResp = Net::HTTP.post_form(@uri, @params) net_log(@params, httpResp.body) Response.new(httpResp.body, @config) end |