I am trying to parse a file containing multiple header and data so that header part
HTTP/1.1 302 Found Cache-Control: no-store, no-cache, private Pragma: no-cache Expires: Sat, 15 Nov 2008 16:00:00 GMT P3P: policyref="http://cdn.adnxs.com/w3c/policy/p3p.xml", CP="NOI DSP COR ADM PSAo PSDo OURo SAMo UNRo OTRo BUS COM NAV DEM STA PRE" X-XSS-Protection: 0 Location: http://ib.adnxs.com/tt?id=868557&size=728x90&referrer=facebook.com Date: Thu, 31 Jan 2013 05:49:01 GMT Content-Length: 0 Content-Type: text/html; charset=ISO-8859-1
can be written into a separate file(.header) and the content after this header information can be stored in a data file(.data).
But problem comes when some header part contains ETag field and the header where only ETag is written in place on HTTP.
What should be the logic so that it can be parsed??