How do I download a file and send a file using Vapor server side swift?
问题 How do I download a file using server side swift? I have tried this: let result = try drop.client.get("http://dropcanvas.com/ir4ok/1") but result.body always = 0 elements How do I send a file? I have tried this drop.get("theFile") { request in let file = NSData(contentsOf: "/Users/bob.zip") return file // This fails here } 回答1: Download a file. You are on the right track here, but the reason why result.body is always empty is because your file service is returning a 302 redirection rather