set_form
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
set_form(params, enctype='application/x-www-form-urlencoded', formopt={})
public
Set a HTML form data set. params is the form data set; it is an Array of Arrays or a Hash +enctype is the type to encode the form data set. It is application/x-www-form-urlencoded or multipart/form-data. formpot is an optional hash to specify the detail.
boundary |
the boundary of the multipart message |
charset |
the charset of the message. All names and the values of non-file fields are encoded as the charset. |
Each item of params is an array and contains following items:
name |
the name of the field |
value |
|
opt |
an optional hash to specify additional information |
Each item is a file field or a normal field. If value is a File object or the opt have a filename key, the item is treated as a file field.
If Transfer-Encoding is set as chunked, this send the request in chunked encoding. Because chunked encoding is HTTP/1.1 feature, you must confirm the server to support HTTP/1.1 before sending it.
Example:
http.set_form([["q", "ruby"], ["lang", "en"]])
See also RFC 2388, RFC 2616, HTML 4.01, and HTML5