Essentially, you:
- accept a client socket
- read the request line (GET foo or POST foo)
- read the rest of the request headers (until you read
a blank line)
- read the body of the request--this is the content
as submitted by a POST request.
Take a look at HTTP::Daemon. You can either use the module
or take a look at how it works, to see how you can write
your own server. | [reply] |
If this is just an academic excercise I would suggest www.ietf.org
so that you can read all about how http protocol needs to be implemented.
If this is something that you need to get something done,
see the first reply.
Otherwise the traffic over the socket will look something
like this.
HTTP 1.0 POST
URL:foo
User-Agent: foo
foo=bar&perl=cool
note that there is a blank line btw the header and the URL params
| [reply] |
What you want may already have been done... check out perl-server. | [reply] |