Super! ... almost what I was looking for .... I mean one minor fix is that I have to call a (line) after (read) to read up the newline after the content length. Also, I need to figure out how to capture the body .... do I do a pipe? Regards, Kashyap
On Sat, May 18, 2019 at 11:53 AM Alexander Burger <a...@software-lab.de> wrote: > On Sat, May 18, 2019 at 08:11:20PM +0200, Alexander Burger wrote: > > You can easily write a stand-alone server without any library: > > ... > > Hmm, this was too short. I haven't tested, but at least we should respond > something. Perhaps this is a better starting point: > > (setq *Port (port 8080)) > > (loop > (setq *Sock (listen *Port)) > (unless (fork) > (close *Port) > (in *Sock > (when (from "Content-Length: ") > (let Len (read) > (while (line)) # Skip rest of header > (out NIL (echo Len)) ) ) ) > (out *Sock > (prinl "HTTP/1.1 200 OK^M") > (prinl "Content-Length: 0^M^J^M") > (prinl "^M") > (prinl "^M") ) > (bye) ) > (close *Sock) ) > > Just for experimentation ... ;) > > ☺/ A!ex > > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >