in reply to if method is POST...

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