Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make using custom headers easier/nicer #94

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/httpbeast.nim
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,10 @@ proc send*(req: Request, body: string, code = Http200) {.inline.} =
## **Warning:** This can only be called once in the OnRequest callback.
req.send(code, body)

proc send*(req: Request, body: string, headers: string, code = Http200) =
## Sends a HTTP 200 OK response with the specified body and headers.
req.send(code, body, headers)

proc httpMethod*(req: Request): Option[HttpMethod] {.inline.} =
## Parses the request's data to find the request HttpMethod.
parseHttpMethod(req.selector.getData(req.client).data, req.start)
Expand Down