You'd have to quite drastically fork and modify [httpclient.nim](https://github.com/nim-lang/Nim/blob/devel/lib/pure/httpclient.nim)
Since there are various alternative ways how content length is encoded, depending on transfer-encoding being chucked, missing content-length headers, etc it will be moderately involved to change and adapt `parseBody`, `parseChunks` and `recvFull` to stop receiving after N bytes.
