parse request/response lines and headers