class WWW::Mechanize::Form
def request_data
for this form, depending on if this is a regular post, get, or a
This method calculates the request data to be sent back to the server
def request_data query_params = build_query() case @enctype.downcase when /^multipart\/form-data/ boundary = rand_string(20) @enctype = "multipart/form-data; boundary=#{boundary}" params = [] query_params.each { |k,v| params << param_to_multipart(k, v) } @file_uploads.each { |f| params << file_to_multipart(f) } params.collect { |p| "--#{boundary}\r\n#{p}" }.join('') + "--#{boundary}--\r\n" else WWW::Mechanize::Util.build_query_string(query_params) end end