parse HTTP header and method