Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BOUNDARY = "AaB03x"
- def encode_multipartformdata(parameters = {})
- ret = String.new
- parameters.each do |key, value|
- unless value.empty?
- ret << "rn--" << BOUNDARY << "rn"
- ret << "Content-Disposition: form-data; name="#{key}"rnrn"
- ret << value
- end
- end
- ret << "rn--" << BOUNDARY << "--rn"
- end
Add Comment
Please, Sign In to add comment