Re: Can I use wildcard pattern matching in Libsoup server?



On Tue, 2021-08-31 at 11:22 +0100, Ashutosh Naik via libsoup-list
wrote:
I am using libsoup to implement a HTTP server. I want to catch all
wildcard patterns of the form -
"/foo/*/bar/"
in the URL but I dont know how to do this right now.
How can I implement this using the Libsoup and GLib libraries?
My current code is using:
soup_server_add_handler (server, "/foo/*/bar/", NULL,
server_callback,
             unregister_callback, data);

The above doesnt work if I try to catch the URL "/foo/abc/bar"
Please let me know if this is possible in libsoup and what is the
correct syntax to be passed to soup_server_add_handler()

I think you have to create a generic handler (either for "/" or for
"/foo") and then decide on the path that is passed into the callback
and otherwise 404 or whatever the appropriate status would be




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]