vendor/plugins/mocha/vendor/meta_project-0.4.15/lib/meta_project/http/multipart.rb
# Converts an Array or Hash into HTTP POST params
Converts an Array or Hash into HTTP POST params
Converts an Array or Hash into HTTP POST params
def post_data(*params)
        form = []
        params.each do |param|
          case param
          when Array
            form << param
          when Hash
            param.each do |key, value|
              form <<
                "--#{BOUNDARY}" <<
                %Q(Content-Disposition: form-data; name="#{key}") <<
                "" << value
            end
          end
        end
        form.flatten.join("\r\n")
      end
def post_data ( * params ) form = [ ] params . each do | param | case param when Array form << param when Hash param . each do | key , value | form << "--#{BOUNDARY}" << %Q(Content-Disposition: form-data; name="#{key}") << "" << value end end end form . flatten . join ( "\r\n" ) end
Converts an Array or Hash into HTTP POST params
Converts an Array or Hash into HTTP POST params
params
<not_specific>