Implement file streaming for httpclient's MultipartData (#12982)

* Add `uploadFile` to POST files by streaming them

* Use constant for \c\L

* Formatting

* Remove uploadFile

* Implement MultipartData file streaming

* Remove unnecessary var annotations

* Call string on TaintedStrings

Fixes #12789

* Move cl constant to httpcore

* Fix `request` inconsistencies

* Update documentaion

* Clean up

* Skip multipart formatting when there's 0 entries

* Remove extraneous `cl` from multipart formatting

* Update MultipartData `$` to match old behaviour

* Update comment

* Address comments
This commit is contained in:
Zed 2020-03-06 19:55:45 +01:00 • committed by GitHub
commit e056298ceb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 207 additions and 142 deletions

View file

@ -97,6 +97,7 @@ const
Http504* = HttpCode(504)
Http505* = HttpCode(505)
const httpNewLine* = "\c\L"
const headerLimit* = 10_000
proc newHttpHeaders*(): HttpHeaders =