diff options
Diffstat (limited to 'lib/pure/httpcore.nim')
-rw-r--r-- | lib/pure/httpcore.nim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pure/httpcore.nim b/lib/pure/httpcore.nim index 0515eeecd..1fded8248 100644 --- a/lib/pure/httpcore.nim +++ b/lib/pure/httpcore.nim @@ -226,7 +226,7 @@ proc `$`*(code: HttpCode): string = ## For example: ## ## .. code-block:: nim - ## doAssert(Http404.status == "404 Not Found") + ## doAssert($Http404 == "404 Not Found") case code.int of 100: "100 Continue" of 101: "101 Switching Protocols" @@ -298,6 +298,9 @@ proc is5xx*(code: HttpCode): bool = ## Determines whether ``code`` is a 5xx HTTP status code. return code.int in {500 .. 599} +proc `$`*(httpMethod: HttpMethod): string = + return (system.`$`(httpMethod))[4 .. ^1].toUpper() + when isMainModule: var test = newHttpHeaders() test["Connection"] = @["Upgrade", "Close"] |