Module: RestClient

Defined in:
lib/rest_client.rb,
lib/resource.rb,
lib/request_errors.rb

Overview

This module’s static methods are the entry point for using the REST client.

Defined Under Namespace

Classes: Exception, Redirect, Request, RequestFailed, RequestTimeout, Resource, ResourceNotFound, ServerBrokeConnection, Unauthorized

Class Method Summary collapse

Class Method Details

.delete(url, headers = {}) ⇒ Object



29
30
31
32
33
# File 'lib/rest_client.rb', line 29

def self.delete(url, headers={})
	Request.execute(:method => :delete,
		:url => url,
		:headers => headers)
end

.get(url, headers = {}) ⇒ Object



9
10
11
12
13
# File 'lib/rest_client.rb', line 9

def self.get(url, headers={})
	Request.execute(:method => :get,
		:url => url,
		:headers => headers)
end

.post(url, payload, headers = {}) ⇒ Object



15
16
17
18
19
20
# File 'lib/rest_client.rb', line 15

def self.post(url, payload, headers={})
	Request.execute(:method => :post,
		:url => url,
		:payload => payload,
		:headers => headers)
end

.put(url, payload, headers = {}) ⇒ Object



22
23
24
25
26
27
# File 'lib/rest_client.rb', line 22

def self.put(url, payload, headers={})
	Request.execute(:method => :put,
		:url => url,
		:payload => payload,
		:headers => headers)
end