Class: HTTP::FormData::Urlencoded
- Inherits:
-
Object
- Object
- HTTP::FormData::Urlencoded
- Includes:
- Readable
- Defined in:
- lib/http/form_data/urlencoded.rb
Overview
application/x-www-form-urlencoded form data.
Instance Method Summary collapse
-
#content_type ⇒ String
Returns MIME type to be used for HTTP request
Content-Typeheader. -
#initialize(data) ⇒ Urlencoded
constructor
A new instance of Urlencoded.
Methods included from Readable
Constructor Details
#initialize(data) ⇒ Urlencoded
Returns a new instance of Urlencoded.
15 16 17 18 |
# File 'lib/http/form_data/urlencoded.rb', line 15 def initialize(data) uri_encoded_data = ::URI.encode_www_form FormData.ensure_hash(data) @io = StringIO.new(uri_encoded_data) end |
Instance Method Details
#content_type ⇒ String
Returns MIME type to be used for HTTP request Content-Type header.
23 24 25 |
# File 'lib/http/form_data/urlencoded.rb', line 23 def content_type "application/x-www-form-urlencoded" end |