I'm currently trying to send multiple files to a webservice (and to proceed, depending on the response afterwards, but that's not where I am at yet). The following code sends one file:
def show
...
conn = Faraday.new(:url => 'webservice.abc' ) do |faraday|
faraday.request :multipart
faraday.adapter :net_http
end
payload = { :files => Faraday::UploadIO.new("#{Rails.root}/fileone.xml", 'application/xml') }
conn.post 'http://webservice.abc', payload
@output = response.body
end
And now I'm stuck, trying to find a way to send 2 (or more) files at once, which is necessary as the purpose of the webservice is to compare these. It seems that when I put them into an array, they can't be handled with. So what I'm looking for is the way to "bundle" the files in order to POST them afterwards (as said before- it works with one file)
TYIA for your time