📁 File Manager Pro
v10.0.3 | PHP: 8.1.34
Server: Apache
2026-06-22 18:07:55
📂
/ (Root)
/
opt
/
alt
/
ruby33
/
share
/
ri
/
system
/
Net
/
HTTPHeader
📍 /opt/alt/ruby33/share/ri/system/Net/HTTPHeader
🔄 Refresh
✏️
Editing: set_form_data-i.ri
Read Only
U:RDoc::AnyMethod[iI"set_form_data:ETI""Net::HTTPHeader#set_form_data;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"SSets the request body to a URL-encoded string derived from argument +params+, ;TI";and sets request header field <tt>'Content-Type'</tt> ;TI"5to <tt>'application/x-www-form-urlencoded'</tt>.;To:RDoc::Markup::BlankLine o; ; [I"HThe resulting request is suitable for HTTP request +POST+ or +PUT+.;T@o; ; [I"FArgument +params+ must be suitable for use as argument +enum+ to ;TI"9{URI.encode_www_form}[rdoc-ref:URI.encode_www_form].;T@o; ; [I"(With only argument +params+ given, ;TI"Ssets the body to a URL-encoded string with the default separator <tt>'&'</tt>:;T@o:RDoc::Markup::Verbatim; [I".req = Net::HTTP::Post.new('example.com') ;TI" ;TI".req.set_form_data(q: 'ruby', lang: 'en') ;TI"/req.body # => "q=ruby&lang=en" ;TI"Breq['Content-Type'] # => "application/x-www-form-urlencoded" ;TI" ;TI"8req.set_form_data([['q', 'ruby'], ['lang', 'en']]) ;TI"/req.body # => "q=ruby&lang=en" ;TI" ;TI"8req.set_form_data(q: ['ruby', 'perl'], lang: 'en') ;TI"6req.body # => "q=ruby&q=perl&lang=en" ;TI" ;TI"Greq.set_form_data([['q', 'ruby'], ['q', 'perl'], ['lang', 'en']]) ;TI"6req.body # => "q=ruby&q=perl&lang=en" ;T:@format0o; ; [I",With string argument +sep+ also given, ;TI"'uses that string as the separator:;T@o;; [I"5req.set_form_data({q: 'ruby', lang: 'en'}, '|') ;TI"$req.body # => "q=ruby|lang=en" ;T; 0o; ; [I"NNet::HTTPHeader#form_data= is an alias for Net::HTTPHeader#set_form_data.;T: @fileI"lib/net/http/header.rb;T:0@omit_headings_from_table_of_contents_below000[[I"form_data=;To;; [ ;@7;0I"(params, sep = '&');T@7FI"HTTPHeader;TcRDoc::NormalModule00
💾 Save Changes
❌ Cancel