Completed extractContentLength() so it is more general and works without assumptions
started working on the GET handling part