Module: RestClient

Defined in:
lib/rest_client.rb

Overview

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

Defined Under Namespace

Classes: Request

Class Method Summary collapse

Class Method Details

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



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

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

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



6
7
8
# File 'lib/rest_client.rb', line 6

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

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



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

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

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



14
15
16
# File 'lib/rest_client.rb', line 14

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