I'm a newbie in lisp,and i was atractted by this interesting book.However,when I tried the webserver provided in the chapter 13,a problem puzzled me. my firefox get the stream as the plain text rather than html format. I'was confused so I tried konqueror as well,the server even didn't work! Then I tried opera,plain text as well. I tried to read the http request through firebugs to find something,but didn't have any idea about the problem I tried to resort to google but it didn't help either.
Is there any one that have any idea about solving this problem? Thanks,and be sorry for poor English.
The problem with things like web servers are there are so many things that could be wrong and they may not be to do with lisp.
The other problem is that it sounds like you are trying to learn about two things at the same time; making a web serve and programming lisp. This is not a problem but don't confuse not understanding lisp with not getting a web server up and running.
It sounds like the output being sent is being read in as plain text rather than html. These options are set by mime types.
The first thing I would do is use telnet to connect to the server and see what response you get back. This will show that lisp is working and sending information out on the port (we know that already because some web servers are showing information). But it will also show you the text your web server is sending on a successful connection.
You can google the responses that a web server should accept and respond to. A good starting place is here
On Saturday, May 12, 2012 3:44:13 AM UTC+1, reverland wrote:
> I'm a newbie in lisp,and i was atractted by this interesting > book.However,when I tried the webserver provided in the chapter 13,a > problem puzzled me. > my firefox get the stream as the plain text rather than html format. > I'was confused so I tried konqueror as well,the server even didn't work! > Then I tried opera,plain text as well. > I tried to read the http request through firebugs to find something,but > didn't have any idea about the problem > I tried to resort to google but it didn't help either.
> Is there any one that have any idea about solving this problem? > Thanks,and be sorry for poor English.
Thanks for detailed response,It's really helpful.
I don't know much about telnet,but I've found some important clues in
wikipedia.
Then I added a line before the server response followed with a blank line:
HTTP/1.1 200 OK
wonderfully it worked!!
Thanks again!
2012/5/12 Purity Control <cr...@puritycontrol.net>
> On Saturday, May 12, 2012 3:44:13 AM UTC+1, reverland wrote:
>> I'm a newbie in lisp,and i was atractted by this interesting
>> book.However,when I tried the webserver provided in the chapter 13,a
>> problem puzzled me.
>> my firefox get the stream as the plain text rather than html format.
>> I'was confused so I tried konqueror as well,the server even didn't work!
>> Then I tried opera,plain text as well.
>> I tried to read the http request through firebugs to find something,but
>> didn't have any idea about the problem
>> I tried to resort to google but it didn't help either.
>> Is there any one that have any idea about solving this problem?
>> Thanks,and be sorry for poor English.
You'd better keep the html standards if you want the server worked under firefox10 or higher.Some change is needed,such as <html><head><head/><body>...<body/><html/>,and HTTP/1.1 200 OK followed with a blank line.
在 2012年5月12日星期六UTC+8上午10时44分13秒,reverland写道:
> I'm a newbie in lisp,and i was atractted by this interesting > book.However,when I tried the webserver provided in the chapter 13,a > problem puzzled me.
> my firefox get the stream as the plain text rather than html format.
> I'was confused so I tried konqueror as well,the server even didn't work!
> Then I tried opera,plain text as well.
> I tried to read the http request through firebugs to find something,but > didn't have any idea about the problem
> I tried to resort to google but it didn't help either.
> Is there any one that have any idea about solving this problem?
> Thanks,and be sorry for poor English.