Class: Vidsy::Data::API::Request
- Inherits:
-
Object
- Object
- Vidsy::Data::API::Request
- Defined in:
- lib/vidsy/data/api/request.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.get(path) ⇒ Object
10 11 12 |
# File 'lib/vidsy/data/api/request.rb', line 10 def self.get(path) new.get path end |
.post(path, options = {}) ⇒ Object
14 15 16 |
# File 'lib/vidsy/data/api/request.rb', line 14 def self.post(path, = {}) new.post(path, ) end |
Instance Method Details
#get(path) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/vidsy/data/api/request.rb', line 18 def get(path) connection.get do |r| r.url complete_path(path) r..timeout = TIMEOUT end end |
#post(path, options) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/vidsy/data/api/request.rb', line 25 def post(path, ) connection.post do |r| r.body = .to_json r.headers["Content-Type"] = "application/json" r.url complete_path(path) r..timeout = TIMEOUT end end |