There is such a text:
Date: Fri, 01 Apr 2016 03:21:49 GMT Server: nginx Content-Type: application/x-rar-compressed Cache-Control: no-cache, private Connection: keep-alive Accept-Ranges: bytes Keep-Alive: timeout=15 Content-Length: 63000000
or it may be something like this:
Date: Fri, 01 Apr 2016 03:17:30 GMT Last-Modified: Sat, 13 Dec 2014 08:28:52 GMT Server: nginx ETag: W/"548bf8c4-28496" Vary: Accept-Encoding Content-Type: image/jpeg Connection: keep-alive Content-Encoding: gzip
In general, you need to parse (if there is no text with a value, then the pass, as for example in the first example there is a Content-Lenth: ..., and in the second there is no) the following:
Content-Type: ..... (maybe just something like application / exe, image / png, etc.)
Content-Length: ..... (can be any numbers)
How can I do that? considering that one or both values may be missing