diff options
author | bptato <nincsnevem662@gmail.com> | 2023-12-28 21:19:21 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-12-28 21:23:26 +0100 |
commit | d91d1dda2ad1219b3b798eafc14151811ed9a1b3 (patch) | |
tree | f82d8da0763f0dbc62dedb2aa9aaa51114d2aad9 /src/loader/request.nim | |
parent | b035e53d641d71fab89f92cd8d5188501be0d058 (diff) | |
download | chawan-d91d1dda2ad1219b3b798eafc14151811ed9a1b3.tar.gz |
Compile with styleCheck:usages
much better
Diffstat (limited to 'src/loader/request.nim')
-rw-r--r-- | src/loader/request.nim | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/loader/request.nim b/src/loader/request.nim index aea5bd46..521362bc 100644 --- a/src/loader/request.nim +++ b/src/loader/request.nim @@ -69,8 +69,8 @@ type type Request* = ref RequestObj RequestObj* = object - httpmethod*: HttpMethod - url*: Url + httpMethod*: HttpMethod + url*: URL headers* {.jsget.}: Headers body*: Opt[string] multipart*: Opt[FormData] @@ -158,14 +158,14 @@ proc newReadableStream*(isource: Stream): ReadableStream = if len != 0: isource.readStr(len, result.buf) -func newRequest*(url: URL, httpmethod = HTTP_GET, headers = newHeaders(), +func newRequest*(url: URL, httpMethod = HTTP_GET, headers = newHeaders(), body = opt(string), multipart = opt(FormData), mode = RequestMode.NO_CORS, credentialsMode = CredentialsMode.SAME_ORIGIN, destination = RequestDestination.NO_DESTINATION, proxy: URL = nil, referrer: URL = nil, canredir = false): Request = return Request( url: url, - httpmethod: httpmethod, + httpMethod: httpMethod, headers: headers, body: body, multipart: multipart, @@ -176,7 +176,7 @@ func newRequest*(url: URL, httpmethod = HTTP_GET, headers = newHeaders(), proxy: proxy ) -func newRequest*(url: URL, httpmethod = HTTP_GET, +func newRequest*(url: URL, httpMethod = HTTP_GET, headers: seq[(string, string)] = @[], body = opt(string), multipart = opt(FormData), mode = RequestMode.NO_CORS, proxy: URL = nil, canredir = false): @@ -185,7 +185,7 @@ func newRequest*(url: URL, httpmethod = HTTP_GET, for pair in headers: let (k, v) = pair hl.table[k] = @[v] - return newRequest(url, httpmethod, hl, body, multipart, mode, proxy = proxy) + return newRequest(url, httpMethod, hl, body, multipart, mode, proxy = proxy) func createPotentialCORSRequest*(url: URL, destination: RequestDestination, cors: CORSAttribute, fallbackFlag = false): Request = var mode = if cors == NO_CORS: @@ -312,7 +312,7 @@ func newRequest*[T: string|Request](ctx: JSContext, resource: T, proxyUrl = init.proxyUrl return ok(Request( url: url, - httpmethod: httpmethod, + httpMethod: httpMethod, headers: headers, body: body, multipart: multipart, |