diff options
author | bptato <nincsnevem662@gmail.com> | 2022-08-18 19:42:08 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-08-18 19:42:43 +0200 |
commit | 18273ea45d45558641a1020932b141ed0d165e12 (patch) | |
tree | aac7216cd18430a7539f216c545630a9e2d4ae49 /src/io/request.nim | |
parent | a78c26198e747d4de887e1f582d29f14fb59391b (diff) | |
download | chawan-18273ea45d45558641a1020932b141ed0d165e12.tar.gz |
Clean up client request methods, add DUPE_BUFFER
Diffstat (limited to 'src/io/request.nim')
-rw-r--r-- | src/io/request.nim | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/io/request.nim b/src/io/request.nim index 461a3680..68706c49 100644 --- a/src/io/request.nim +++ b/src/io/request.nim @@ -67,27 +67,16 @@ func newRequest*(url: Url, httpmethod = HTTP_GET, headers: openarray[(string, string)] = [], body = none(string), - multipart = none(MimeData), - defaultHeaders = none(HeaderList)): Request = + multipart = none(MimeData)): Request = new(result) result.httpmethod = httpmethod result.url = url - if defaultHeaders.issome: - result.headers.table = defaultHeaders.get.table for it in headers: if it[1] != "": #TODO not sure if this is a good idea, options would probably work better result.headers.table[it[0]] = @[it[1]] result.body = body result.multipart = multipart -func newRequest*(loader: FileLoader, - url: Url, - httpmethod = HTTP_GET, - headers: openarray[(string, string)] = [], - body = none(string), - multipart = none(MimeData)): Request = - newRequest(url, httpmethod, headers, body, multipart, some(loader.defaultHeaders)) - proc `[]=`*(multipart: var MimeData, k, v: string) = multipart.content.add(MimePart(name: k, content: v)) |