parent
387d598cfb
commit
ee62d56cad
1 changed files with 4 additions and 2 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue