def urloption(url, headers={}, retries=RETRIES):
headers_merged = default_headers.copy()<EOL>for key in headers.keys():<EOL><INDENT>headers_merged[key] = headers[key]<EOL><DEDENT>schema = urllib.parse.urlparse(url)<EOL>for i in range(retries):<EOL><INDENT>try:<EOL><INDENT>conn = http.client.HTTPConnection(schema.netloc)<EOL>conn.request('<STR_LIT>', url, headers=headers_merged)<EOL>resp = conn.getresponse()<EOL>return resp<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>
发送OPTION 请求