'Prepares the given HTTP headers.'

def prepare_headers(self, headers):

    if headers:
        headers = dict(((name.encode('ascii'), value) for (name, value) in headers.items()))
        self.headers = CaseInsensitiveDict(headers)
    else:
        self.headers = CaseInsensitiveDict()
