Class: RestClient::Payload::UrlEncoded
- Defined in:
- lib/vendor/rest-client/lib/rest_client/payload.rb
Instance Method Summary collapse
Methods inherited from Base
#close, #escape, #initialize, #read, #size
Constructor Details
This class inherits a constructor from RestClient::Payload::Base
Instance Method Details
#build_stream(params) ⇒ Object
53 54 55 56 57 58 |
# File 'lib/vendor/rest-client/lib/rest_client/payload.rb', line 53 def build_stream(params) @stream = StringIO.new(params.map do |k,v| "#{escape(k)}=#{escape(v)}" end.join("&")) @stream.seek(0) end |
#headers ⇒ Object
60 61 62 |
# File 'lib/vendor/rest-client/lib/rest_client/payload.rb', line 60 def headers super.merge({ 'Content-Type' => 'application/x-www-form-urlencoded' }) end |