mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 14:23:45 +00:00
@@ -294,9 +294,11 @@ proc request*(url: string, httpMethod = httpGET, extraHeaders = "",
|
||||
var r = if proxy == nil: parseUri(url) else: proxy.url
|
||||
var headers = substr($httpMethod, len("http"))
|
||||
if proxy == nil:
|
||||
headers.add(" /" & r.path)
|
||||
echo url
|
||||
headers.add(" " & r.path)
|
||||
if r.query.len > 0:
|
||||
headers.add("?" & r.query)
|
||||
echo headers
|
||||
else:
|
||||
headers.add(" " & url)
|
||||
|
||||
@@ -444,7 +446,7 @@ proc generateHeaders(r: Uri, httpMethod: HttpMethod,
|
||||
headers: StringTableRef): string =
|
||||
result = substr($httpMethod, len("http"))
|
||||
# TODO: Proxies
|
||||
result.add(" /" & r.path)
|
||||
result.add(" " & r.path)
|
||||
if r.query.len > 0:
|
||||
result.add("?" & r.query)
|
||||
result.add(" HTTP/1.1\c\L")
|
||||
|
||||
Reference in New Issue
Block a user