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