Class: Xendit::ApiClient

Inherits:
Object
  • Object
show all
Defined in:
lib/xendit/api_client.rb

Class Method Summary collapse

Class Method Details

.get(url, headers: {}, params: nil) ⇒ Object



9
10
11
12
13
# File 'lib/xendit/api_client.rb', line 9

def get(url, headers: {}, params: nil)
  conn = create_connection(headers)
  response = conn.get(url, params)
  handle_response(response)
end

.post(url, headers: {}, body: {}) ⇒ Object



15
16
17
18
19
# File 'lib/xendit/api_client.rb', line 15

def post(url, headers: {}, body: {})
  conn = create_connection(headers)
  response = conn.post(url, JSONSerializer.encode(body))
  handle_response(response)
end