Module: HTTParty

Extended by:
AllowedFormatsDeprecation
Included in:
Basement
Defined in:
lib/httparty.rb,
lib/httparty/parser.rb,
lib/httparty/request.rb,
lib/httparty/response.rb,
lib/httparty/exceptions.rb,
lib/httparty/core_extensions.rb,
lib/httparty/module_inheritable_attributes.rb

Defined Under Namespace

Modules: AllowedFormatsDeprecation, ClassMethods, ModuleInheritableAttributes Classes: Basement, BasicObject, CookieHash, Parser, RedirectionTooDeep, Request, Response, ResponseError, UnsupportedFormat, UnsupportedURIScheme

Constant Summary collapse

VERSION =
"0.6.1".freeze
CRACK_DEPENDENCY =
"0.1.8".freeze

Class Method Summary collapse

Methods included from AllowedFormatsDeprecation

const_missing

Class Method Details

.delete(*args) ⇒ Object



361
362
363
# File 'lib/httparty.rb', line 361

def self.delete(*args)
  Basement.delete(*args)
end

.get(*args) ⇒ Object



349
350
351
# File 'lib/httparty.rb', line 349

def self.get(*args)
  Basement.get(*args)
end

.head(*args) ⇒ Object



365
366
367
# File 'lib/httparty.rb', line 365

def self.head(*args)
  Basement.head(*args)
end

.included(base) ⇒ Object



34
35
36
37
38
39
40
41
# File 'lib/httparty.rb', line 34

def self.included(base)
  base.extend ClassMethods
  base.send :include, HTTParty::ModuleInheritableAttributes
  base.send(:mattr_inheritable, :default_options)
  base.send(:mattr_inheritable, :default_cookies)
  base.instance_variable_set("@default_options", {})
  base.instance_variable_set("@default_cookies", CookieHash.new)
end

.normalize_base_uri(url) ⇒ Object

:nodoc:



334
335
336
337
338
339
340
341
342
343
# File 'lib/httparty.rb', line 334

def self.normalize_base_uri(url) #:nodoc:
  normalized_url = url.dup
  use_ssl = (normalized_url =~ /^https/) || normalized_url.include?(':443')
  ends_with_slash = normalized_url =~ /\/$/

  normalized_url.chop! if ends_with_slash
  normalized_url.gsub!(/^https?:\/\//i, '')

  "http#{'s' if use_ssl}://#{normalized_url}"
end

.options(*args) ⇒ Object



369
370
371
# File 'lib/httparty.rb', line 369

def self.options(*args)
  Basement.options(*args)
end

.post(*args) ⇒ Object



353
354
355
# File 'lib/httparty.rb', line 353

def self.post(*args)
  Basement.post(*args)
end

.put(*args) ⇒ Object



357
358
359
# File 'lib/httparty.rb', line 357

def self.put(*args)
  Basement.put(*args)
end