RestClient::Payload::UrlEncoded

Public Instance Methods

build_stream(params = nil) click to toggle source
# File lib/restclient/payload.rb, line 141
def build_stream(params = nil)
  @stream = StringIO.new(flatten_params(params).collect do |entry|
    "#{entry[0]}=#{handle_key(entry[1])}"
  end.join("&"))
  @stream.seek(0)
end
handle_key(key) click to toggle source

for UrlEncoded escape the keys

# File lib/restclient/payload.rb, line 149
def handle_key key
  URI.escape(key.to_s, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
end
headers() click to toggle source
# File lib/restclient/payload.rb, line 153
def headers
  super.merge({'Content-Type' => 'application/x-www-form-urlencoded'})
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.