On 2011-10-17 16:01, Andrea Fontana wrote:
I handle request on different threads. I do some pre-processing on
scgi data and I fill a struct:
request.get[]
request.post[]
request.cookie[]
request.headers[string]
then I call a virtual function (to override on subclasses) like:
do(request, output);
where user fill output struct in a way like:
output.data ~= "<html><body><h1>hello world</h1></body></html>";
output.status = 200
output.cookies = bla bla
and then if is method != "head" i send headers + data, else just
"headers".
btw 99% of usage is get, post, head.
Yes, but if you want to write a web site that is RESTful you need the
other HTTP methods as well, at least PUT and DELETE.
BTW, what about creating something like Rack but for D. Rack is a low
level interface in front of the web server which web frameworks can be
built on top.
http://rack.github.com/
--
/Jacob Carlborg