'Reads a response from a file-like object (it must implement
``.read(size)`` and ``.readline()``).
It will read up to the end of the response, not the end of the
file.
This reads the response as represented by ``str(resp)``; it
may not read every valid HTTP response properly.  Responses
must have a ``Content-Length``'

@classmethod
def from_file(cls, fp):

    headerlist = []
    status = fp.readline().strip()
    is_text = isinstance(status, text_type)
    if is_text:
        _colon = ':'
    else:
        _colon = ':'
    while 1:
        line = fp.readline().strip()
        if (not line):
            break
        try:
            (header_name, value) = line.split(_colon, 1)
        except ValueError:
            raise ValueError(('Bad    header    line:    %r' % line))
        value = value.strip()
        if (not is_text):
            header_name = header_name.decode('utf-8')
            value = value.decode('utf-8')
        headerlist.append((header_name, value))
    r = cls(status=status, headerlist=headerlist, app_iter=())
    body = fp.read((r.content_length or 0))
    if is_text:
        r.text = body
    else:
        r.body = body
    return r
