[PATCH] D114415: [llvm] [Support] (WIP) Add HTTP Client Support library.
Noah Shutty via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 23 16:05:27 PST 2021
noajshu marked 5 inline comments as done.
noajshu added inline comments.
================
Comment at: llvm/lib/Support/HTTPServer.cpp:19
+HTTPServer::HTTPServer(std::function<HTTPResponse(StringRef)> RequestHandler) {
+ Server.Get(R"(/(.*))",
+ [&](const httplib::Request &Request, httplib::Response &Response) {
----------------
phosek wrote:
> I wonder if we should perhaps move this to a separate method (like `get`) and take the path as an argument so we can potentially support multiple handlers.
My initial thought was to support multiple "handlers" using one big handler that would parse the URL and dispatch to the appropriate sub-handler. However it does seem more user-friendly to expose the same interface as cpp-httplib, letting the HTTPServer deal with the url parsing.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114415/new/
https://reviews.llvm.org/D114415
More information about the llvm-commits
mailing list