c9s / r3

libr3 is a high-performance path dispatching library. It compiles your route paths into a prefix tree (trie). By using the constructed prefix trie in the start-up time, you may dispatch your routes with efficiency
http://c9s.github.com/r3/bench.html
MIT License
813 stars 83 forks source link

Option to insert route with Content-Type as part of arguments #102

Open badarihp opened 7 years ago

badarihp commented 7 years ago

Hi , Very much impressed by the implementation and performance of this library. I was looking for a API like r3_tree_insert_routel_ex that can take Content-Type as part of arguments while insert the route. Let me know if we have any such API for my requirements :

For Ex: tree.insert_routel(METHOD_GET | METHODPOST, "/blog/post", "application/json",_ sizeof("/blog/post") - 1, &route_data);

... find the route : r3::MatchEntry entry("/blog/post"); entry.set_request_method(METHODGET); entry.set_content_type("application/json");_

r3::Route matched_route = tree.match_route(entry);

Regards, Badari