[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to read http PUT or POST data from luasocket server
- From: Francisco Olarte <folarte@...>
- Date: Wed, 2 Oct 2013 13:35:53 +0200
>> As I say before, not so simple, you'll be better of searching for some
>> server sample as reference, as completely parsing an HTTP request is not
>> athing you can properly do in a couple of pages of code.
OMG, I managed to make an awful lot of language mistakes there, but it
seems I managed to carry the info.
> Accented on properly. Implementing an http server is a great excercise:
> implement one in a couple pages and behold the beauty. Then check the
> sources of any popular webserver, and search fr everithing they do and you
> don't (it's a long list). Then try to understand why they do that, and why
> it's important :-)
AAMOF, I'm presently implementing ( in Java, not in lua, but you can
extrapolate ) a simple server ( only has to take get/post with query
string and/or form data, only returns text/plain or text/json in latin
1 or utf 8 or no content ), and just checking conditions and erroring
out ''properly'' takes way more than the couple of pages. Also,
parsing is really complex, whenever I see the variety of forms for
headers, urls and the like in HTTP/SIP standards I always think the
emphasis is more on having cut&paste examples look pretty in the spec
than on having a protocol which can be sanely parsed.
Francisco Olarte.