Module: Hull::Request

Included in:
Client
Defined in:
lib/hull/request.rb,
lib/hull/request/auth.rb

Overview

Defines HTTP request methods

Defined Under Namespace

Classes: Auth

Constant Summary collapse

API_PATH_REGEXP =
/^\/?api\/v1\//
API_PATH =
'/api/v1/'

Instance Method Summary collapse

Instance Method Details

#delete(path, params = {}, options = {}) ⇒ Object

Perform an HTTP DELETE request



8
9
10
# File 'lib/hull/request.rb', line 8

def delete(path, params={}, options={})
  request(:delete, api_path(path), params, options)
end

#get(path, params = {}, options = {}) ⇒ Object

Perform an HTTP GET request



13
14
15
# File 'lib/hull/request.rb', line 13

def get(path, params={}, options={})
  request(:get, api_path(path), params, options)
end

#post(path, params = {}, options = {}) ⇒ Object

Perform an HTTP POST request



18
19
20
# File 'lib/hull/request.rb', line 18

def post(path, params={}, options={})
  request(:post, api_path(path), params, options)
end

#put(path, params = {}, options = {}) ⇒ Object

Perform an HTTP PUT request



23
24
25
# File 'lib/hull/request.rb', line 23

def put(path, params={}, options={})
  request(:put, api_path(path), params, options)
end