Implement streamed body reading in httpclient.
This commit is contained in:
parent
77071eb767
commit
1b4067a81b
2 changed files with 111 additions and 43 deletions
|
|
@ -13,7 +13,9 @@ proc asyncTest() {.async.} =
|
|||
var client = newAsyncHttpClient()
|
||||
var resp = await client.request("http://example.com/")
|
||||
doAssert(resp.code.is2xx)
|
||||
doAssert("<title>Example Domain</title>" in resp.body)
|
||||
var body = await resp.body
|
||||
body = await resp.body # Test caching
|
||||
doAssert("<title>Example Domain</title>" in body)
|
||||
|
||||
resp = await client.request("http://example.com/404")
|
||||
doAssert(resp.code.is4xx)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue