Class: Phocoder::HTTP::Typhoeus

Inherits:
Object
  • Object
show all
Defined in:
lib/phocoder/http/typhoeus.rb

Class Method Summary collapse

Class Method Details

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



17
18
19
# File 'lib/phocoder/http/typhoeus.rb', line 17

def self.delete(url, options={})
  perform(:delete, url, options)
end

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



13
14
15
# File 'lib/phocoder/http/typhoeus.rb', line 13

def self.get(url, options={})
  perform(:get, url, options)
end

.perform(method, url, options = {}) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/phocoder/http/typhoeus.rb', line 21

def self.perform(method, url, options={})
  if options.delete(:skip_ssl_verify)
    options[:disable_ssl_peer_verification] = true
  end

  ::Typhoeus::Request.send(method, url, options)
end

.post(url, options = {}) ⇒ Object



5
6
7
# File 'lib/phocoder/http/typhoeus.rb', line 5

def self.post(url, options={})
  perform(:post, url, options)
end

.put(url, options = {}) ⇒ Object



9
10
11
# File 'lib/phocoder/http/typhoeus.rb', line 9

def self.put(url, options={})
  perform(:put, url, options)
end