Class: IndexTank::RestClient
- Inherits:
-
Object
- Object
- IndexTank::RestClient
- Defined in:
- lib/indextank_client.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#DELETE(path, params = {}) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/indextank_client.rb', line 25 def DELETE(path, params={}) path = "#{path}?#{to_query(params)}" if params request = Net::HTTP::Delete.new "#{@uri.path}#{path}" request return execute(request) end |
#GET(path, params = {}) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/indextank_client.rb', line 11 def GET(path, params={}) path = "#{path}?#{to_query(params)}" if params request = Net::HTTP::Get.new "#{@uri.path}#{path}" request return execute(request) end |
#PUT(path, body = {}) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/indextank_client.rb', line 18 def PUT(path, body={}) request = Net::HTTP::Put.new "#{@uri.path}#{path}" request request.body = body.to_json if body return execute(request) end |