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

mod rewrite - Using "?" when rewriting the URL -

.htaccess: Transfer name to index.php if not directory public -

Admob integration with pygame in android -