Sha256: 4abe584b2cf6a00b174f97cc780c501d270c6e14a163c49dbde30ef70aaf1ea4

Contents?: true

Size: 851 Bytes

Versions: 13

Compression:

Stored size: 851 Bytes

Contents

require 'restclient'

module RestClient

  def self.ssl_settings
    {
      :verify_ssl => OpenSSL::SSL::VERIFY_PEER,
      :ssl_ca_file => File.join(File.dirname(__FILE__), 'cert')
    }
  end

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

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

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

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

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
fb_graph-1.6.2 lib/restclient_with_ssl_support.rb
fb_graph-1.6.1 lib/restclient_with_ssl_support.rb
fb_graph-1.6.0 lib/restclient_with_ssl_support.rb
fb_graph-1.5.5 lib/restclient_with_ssl_support.rb
fb_graph-1.5.4 lib/restclient_with_ssl_support.rb
fb_graph-1.5.3 lib/restclient_with_ssl_support.rb
fb_graph-1.5.2 lib/restclient_with_ssl_support.rb
fb_graph-1.5.1 lib/restclient_with_ssl_support.rb
fb_graph-1.5.0 lib/restclient_with_ssl_support.rb
fb_graph-1.4.1 lib/restclient_with_ssl_support.rb
fb_graph-1.4.0 lib/restclient_with_ssl_support.rb
fb_graph-1.3.9 lib/restclient_with_ssl_support.rb
fb_graph-1.3.8 lib/restclient_with_ssl_support.rb