<div class="gmail_quote">On Mon, Oct 17, 2011 at 2:11 PM, Jacob Carlborg <span dir="ltr"><<a href="mailto:doob@me.com">doob@me.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 2011-10-17 16:01, Andrea Fontana wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I handle request on different threads. I do some pre-processing on<br>
scgi data and I fill a struct:<br>
<br>
request.get[]<br>
request.post[]<br>
request.cookie[]<br>
request.headers[string]<br>
<br>
then I call a virtual function (to override on subclasses) like:<br>
<br>
do(request, output);<br>
<br>
where user fill output struct in a way like:<br>
<br>
output.data ~= "<html><body><h1>hello world</h1></body></html>";<br>
output.status = 200<br>
output.cookies = bla bla<br>
<br>
and then if is method != "head" i send headers + data, else just<br>
"headers".<br>
<br>
btw 99% of usage is get, post, head.<br>
</blockquote>
<br></div>
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.<br>
<br>
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.<br>
<br>
<a href="http://rack.github.com/" target="_blank">http://rack.github.com/</a><br><font color="#888888">
<br>
-- <br>
/Jacob Carlborg<br>
</font></blockquote></div><br><div>Yes, this is exactly why I was wondering whether FastCGI had been implemented (though SCGI works for me as well) - so that I could write something on top of it, in much the same way I would using (for example) WSGI in Python.</div>
<div><br></div><div>I also agree with you re: supporting all of the HTTP methods. Just because the most common ones are GET, POST, and HEAD doesn't mean we should leave out the others; both PUT and DELETE are quite useful.</div>
<div><br></div><div>Best regards,</div><div>Jeremy Sandell</div>