Class: Wes::Data::API::Request
- Inherits:
-
Object
- Object
- Wes::Data::API::Request
- Defined in:
- lib/wes/data/api/request.rb
Class Method Summary collapse
- .delete(path) ⇒ Object
- .get(path) ⇒ Object
- .post(path, options) ⇒ Object
- .put(path, options) ⇒ Object
Class Method Details
.delete(path) ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/wes/data/api/request.rb', line 36 def delete(path) connection.delete do |r| r..timeout = TIMEOUT r.headers['Content-Type'] = 'application/json' r.url complete_path(path) end end |
.get(path) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/wes/data/api/request.rb', line 10 def get(path) connection.get do |r| r..timeout = TIMEOUT r.headers['Content-Type'] = 'application/json' r.url complete_path(path) end end |
.post(path, options) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/wes/data/api/request.rb', line 18 def post(path, ) connection.post do |r| r.body = .to_json r.headers['Content-Type'] = 'application/json' r..timeout = TIMEOUT r.url complete_path(path) end end |
.put(path, options) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/wes/data/api/request.rb', line 27 def put(path, ) connection.put do |r| r.body = .to_json r.headers['Content-Type'] = 'application/json' r..timeout = TIMEOUT r.url complete_path(path) end end |