ruby - How do I post/upload multiple files at once using HttpClient? -


def test_post_with_file filename = 'test01.xml'     file.open(filename) |file|         response = @http_client.post(url, {'documents'=>file})     end end 

how modify above method handle multi-file-array post/upload?

file_array = ['test01.xml', 'test02.xml'] 

you mean this?

def test_post_with_file(file_array=[])   file_array.each |filename|     file.open(filename) |file|       response = @http_client.post(url, {'documents'=>file})     end   end end 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -