use HTTP1.0 and drop connection:keep-alive

This commit is contained in:
andri lim 2019-01-10 09:40:28 +07:00 committed by zah
parent cbbdc34399
commit b9286104e7
1 changed files with 1 additions and 2 deletions

View File

@ -24,13 +24,12 @@ const
proc sendRequest(transp: StreamTransport,
data: string, httpMethod: HttpMethod): Future[bool] {.async.} =
var request = $httpMethod & " / "
request.add($HttpVersion11)
request.add($HttpVersion10)
request.add("\r\n")
request.add("Date: " & httpDate() & "\r\n")
request.add("Host: " & $transp.remoteAddress & "\r\n")
request.add("Content-Type: application/json\r\n")
request.add("Content-Length: " & $len(data) & "\r\n")
request.add("Connection: keep-alive\r\n")
request.add("\r\n")
if len(data) > 0:
request.add(data)