Module: PaypalAPI::Client::HTTPMethods

Included in:
PaypalAPI::Client
Defined in:
lib/paypal-api/client/http_methods.rb

Overview

Client HTTP methods

Instance Method Summary collapse

Instance Method Details

#delete(path, query: nil, body: nil, headers: nil) ⇒ Object

Executes DELETE http request



58
59
60
# File 'lib/paypal-api/client/http_methods.rb', line 58

def delete(path, query: nil, body: nil, headers: nil)
  execute_request(Net::HTTP::Delete, path, query: query, body: body, headers: headers)
end

#get(path, query: nil, body: nil, headers: nil) ⇒ Object

Executes GET http request



31
32
33
# File 'lib/paypal-api/client/http_methods.rb', line 31

def get(path, query: nil, body: nil, headers: nil)
  execute_request(Net::HTTP::Get, path, query: query, body: body, headers: headers)
end

#patch(path, query: nil, body: nil, headers: nil) ⇒ Object

Executes PATCH http request



40
41
42
# File 'lib/paypal-api/client/http_methods.rb', line 40

def patch(path, query: nil, body: nil, headers: nil)
  execute_request(Net::HTTP::Patch, path, query: query, body: body, headers: headers)
end

#post(path, query: nil, body: nil, headers: nil) ⇒ Object

Executes POST http request



22
23
24
# File 'lib/paypal-api/client/http_methods.rb', line 22

def post(path, query: nil, body: nil, headers: nil)
  execute_request(Net::HTTP::Post, path, query: query, body: body, headers: headers)
end

#put(path, query: nil, body: nil, headers: nil) ⇒ Object

Executes PUT http request



49
50
51
# File 'lib/paypal-api/client/http_methods.rb', line 49

def put(path, query: nil, body: nil, headers: nil)
  execute_request(Net::HTTP::Put, path, query: query, body: body, headers: headers)
end