Feature #7684 ยป set_form_data_string.diff
lib/net/http/header.rb | ||
---|---|---|
# http.set_form_data({"q" => "ruby", "lang" => "en"}, ';')
|
||
#
|
||
def set_form_data(params, sep = '&')
|
||
query = URI.encode_www_form(params)
|
||
if String === params
|
||
query = params
|
||
else
|
||
query = URI.encode_www_form(params)
|
||
end
|
||
query.gsub!(/&/, sep) if sep != '&'
|
||
self.body = query
|
||
self.content_type = 'application/x-www-form-urlencoded'
|