Class: Datacentred::Request::Base
- Inherits:
-
Object
- Object
- Datacentred::Request::Base
- Defined in:
- lib/datacentred/request/base.rb
Overview
Base class for all API requests.
Uses the Faraday library for HTTP interactions.
Class Method Summary collapse
-
.delete(path) ⇒ nil
Access a resource via HTTP DELETE.
-
.get(path) ⇒ Object
Access a resource via HTTP GET.
-
.post(path, payload = nil) ⇒ Object
Access a resource via HTTP POST.
-
.put(path, payload = nil) ⇒ Object
Access a resource via HTTP PUT.
Class Method Details
.delete(path) ⇒ nil
Access a resource via HTTP DELETE.
42 43 44 |
# File 'lib/datacentred/request/base.rb', line 42 def delete(path) action :delete, path end |
.get(path) ⇒ Object
Access a resource via HTTP GET.
13 14 15 |
# File 'lib/datacentred/request/base.rb', line 13 def get(path) action :get, path end |
.post(path, payload = nil) ⇒ Object
Access a resource via HTTP POST.
23 24 25 |
# File 'lib/datacentred/request/base.rb', line 23 def post(path, payload=nil) action :post, path, payload end |
.put(path, payload = nil) ⇒ Object
Access a resource via HTTP PUT.
33 34 35 |
# File 'lib/datacentred/request/base.rb', line 33 def put(path, payload=nil) action :put, path, payload end |