about summary refs log tree commit diff stats
path: root/src/io/request.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-08-18 19:42:08 +0200
committerbptato <nincsnevem662@gmail.com>2022-08-18 19:42:43 +0200
commit18273ea45d45558641a1020932b141ed0d165e12 (patch)
treeaac7216cd18430a7539f216c545630a9e2d4ae49 /src/io/request.nim
parenta78c26198e747d4de887e1f582d29f14fb59391b (diff)
downloadchawan-18273ea45d45558641a1020932b141ed0d165e12.tar.gz
Clean up client request methods, add DUPE_BUFFER
Diffstat (limited to 'src/io/request.nim')
-rw-r--r--src/io/request.nim13
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))