swifter
swifter copied to clipboard
Question:Why [UInt8] for request.body?
I try to upload files by WLAN, but the speed is not as fast as expected.
It looks like let rv = [UInt8](buffer[0..<bytesRead]) which located in Socket.swift cost much time. And the [UInt8] is for request.body.
I wonder why [Uint8] is used as the type of request.body? And will there be potential problem if I use another type(like Data) instead of [UInt8]?
I'm new for Swift and not good at English. Wish I have expressed my question properly.
`[UInt8] is just another way of representing a data blob. You can wrap it in a Data object and it will work fine, see this issue
TLDR: Data(request.body) will do what you want