Class: RestClient::Payload::UrlEncoded

### Home Classes Methods

### In Files

- lib/restclient/payload.rb

### Parent

RestClient::Payload::Base

### Methods

- #build_stream
- #handle_key
- #headers

### Class/Module Index

Quicksearch

- RestClient
- RestClient::AbstractResponse
- RestClient::Exception
- RestClient::ExceptionWithResponse
- RestClient::Exceptions
- RestClient::MaxRedirectsReached
- RestClient::Payload
- RestClient::Payload::Base
- RestClient::Payload::Multipart
- RestClient::Payload::Streamed
- RestClient::Payload::UrlEncoded
- RestClient::Platform
- RestClient::RawResponse
- RestClient::Redirect
- RestClient::Request
- RestClient::Request::Redirect
- RestClient::Request::RequestFailed
- RestClient::RequestFailed
- RestClient::Resource
- RestClient::Response
- RestClient::ResponseForException
- RestClient::SSLCertificateNotVerified
- RestClient::ServerBrokeConnection
- RestClient::Windows
- RestClient::Windows::RootCerts
- RestClient::Windows::RootCerts::CERT_CONTEXT

No matching classes.

# RestClient::Payload::UrlEncoded

### Constants

Escape
Parser

### 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
      Parser.escape(key.to_s, Escape)
    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.