Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
guzba committed Feb 5, 2024
1 parent 33ced84 commit 1686f87
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/basic_router_query_params.nim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import mummy, mummy/routers
proc searchHandler(request: Request) =
var headers: HttpHeaders
headers["Content-Type"] = "text/plain"
request.respond(200, headers, "Name: " & request.query["name"])
request.respond(200, headers, "Name: " & request.queryParams["name"])

var router: Router
router.get("/search", searchHandler)
Expand Down
2 changes: 1 addition & 1 deletion src/mummy.nim
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type
httpMethod*: string ## HTTP method from the request line.
uri*: string ## Raw URI from the HTTP request line.
path*: string ## Decoded request URI path.
query*: QueryParams ## Decoded request query string key-value pairs.
queryParams*: QueryParams ## Decoded request query parameter key-value pairs.
pathValues*: PathValues ## Router named path parameters key-value pairs.
headers*: HttpHeaders ## HTTP headers key-value pairs.
body*: string ## Request body.
Expand Down
4 changes: 2 additions & 2 deletions tests/test_http2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ type TestObject = object
val: int

proc handler(request: Request) =
doAssert "v" in request.query
doAssert request.query.len == 1
doAssert "v" in request.queryParams
doAssert request.queryParams.len == 1
case request.path:
of "/":
if request.httpMethod == "POST":
Expand Down

0 comments on commit 1686f87

Please sign in to comment.