Module: HTTParty

Included in:
Basement
Defined in:
lib/httparty/version.rb,
lib/httparty.rb,
lib/httparty/request.rb,
lib/httparty/response.rb,
lib/httparty/exceptions.rb,
lib/httparty/parsers/xml.rb,
lib/httparty/parsers/json.rb,
lib/httparty/module_inheritable_attributes.rb

Overview

:nodoc:

Defined Under Namespace

Modules: ClassMethods, ModuleInheritableAttributes, Parsers Classes: Basement, CookieHash, RedirectionTooDeep, Request, Response, UnsupportedFormat

Constant Summary collapse

AllowedFormats =
{
  'text/xml'               => :xml,
  'application/xml'        => :xml,
  'application/json'       => :json,
  'text/json'              => :json,
  'application/javascript' => :json,
  'text/javascript'        => :json,
  'text/html'              => :html,
  'application/x-yaml'     => :yaml,
  'text/yaml'              => :yaml
}
Version =
'0.3.1'

Class Method Summary collapse

Class Method Details

.delete(*args) ⇒ Object



192
193
194
# File 'lib/httparty.rb', line 192

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

.get(*args) ⇒ Object



180
181
182
# File 'lib/httparty.rb', line 180

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

.included(base) ⇒ Object



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

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

.normalize_base_uri(url) ⇒ Object

:nodoc:



166
167
168
169
170
171
172
173
174
# File 'lib/httparty.rb', line 166

def self.normalize_base_uri(url) #:nodoc:
  use_ssl = (url =~ /^https/) || url.include?(':443')
  ends_with_slash = url =~ /\/$/
  
  url.chop! if ends_with_slash
  url.gsub!(/^https?:\/\//i, '')
  
  "http#{'s' if use_ssl}://#{url}"
end

.post(*args) ⇒ Object



184
185
186
# File 'lib/httparty.rb', line 184

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

.put(*args) ⇒ Object



188
189
190
# File 'lib/httparty.rb', line 188

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