swift-server / async-http-client

HTTP client library built on SwiftNIO
https://swiftpackageindex.com/swift-server/async-http-client/main/documentation/asynchttpclient
Apache License 2.0
892 stars 110 forks source link

Investigate multipart support for request body #50

Open artemredkin opened 5 years ago

tanner0101 commented 5 years ago

Vapor's multipart / form-data stuff may be worth looking in to for inspiration: https://github.com/vapor/vapor/tree/master/Sources/Vapor/Multipart

This is a considerable amount of code, though, and I'm not sure if this package would be the best place to put it. Most of the functionality is the same for the client and server, so we should really have a separate package for multipart that this package and NIO-based servers could both use.

Ideally, the multipart parser would support streaming, too, since multipart is quite often used for file upload.

I've considered breaking out Vapor's multipart code into a separate package to pitch to the SSWG. Maybe it's worth prioritizing that if we have a potential use case for sharing the code here?