def urlopen_without_redirect(url, headers={}, data=None, retries=RETRIES):
headers_merged = default_headers.copy()<EOL>for key in headers.keys():<EOL><INDENT>headers_merged[key] = headers[key]<EOL><DEDENT>parse_result = urllib.parse.urlparse(url)<EOL>for i in range(retries):<EOL><INDENT>try:<EOL><INDENT>conn = http.client.HTTPConnection(parse_result.netloc)<EOL>if data:<EOL><INDENT>conn.request('<STR_LIT:POST>', url, body=data, headers=headers_merged)<EOL><DEDENT>else:<EOL><INDENT>conn.request('<STR_LIT:GET>', url, body=data, headers=headers_merged)<EOL><DEDENT>return conn.getresponse()<EOL><DEDENT>except OSError:<EOL><INDENT>logger.error(traceback.format_exc())<EOL><DEDENT>except:<EOL><INDENT>logger.error(traceback.format_exc())<EOL><DEDENT><DEDENT>return None<EOL>
请求一个URL, 并返回一个Response对象. 不处理重定向.

    使用这个函数可以返回URL重定向(Error 301/302)后的地址, 也可以重到URL中请
    求的文件的大小, 或者Header中的其它认证信息.