Actions
Feature #5656
closedStatic WResource routing with arguments in path (for RESTful API)
Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
04/14/2017
Due date:
% Done:
0%
Estimated time:
Description
At the moment, static resources can be added to a WServer
with WServer::addResource
and an exact path. It would be useful to be able to add a path with arguments (e.g. "/user/{id}"
), which matches any path starting with /user/
and make the values of these arguments accessible somehow.
Updated by Roel Standaert about 7 years ago
To further improve this, we could also make it possible to add resources defined by a function pointer or lambda function, so that it's not always necessary to subclass WResource.
We can maybe even automatically provide the arguments in the path as parameters, so you can write lambdas like [](const Http::Request &request, Http::Response &response, int id){ ... }
.
Updated by Roel Standaert about 4 years ago
- Status changed from New to Closed
This feature was added in Wt 4.0.4
Actions