本文整理匯總了Python中future.backports.urllib.parse.splithost方法的典型用法代碼示例。如果您正苦於以下問題:Python parse.splithost方法的具體用法?Python parse.splithost怎麽用?Python parse.splithost使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類future.backports.urllib.parse
的用法示例。
在下文中一共展示了parse.splithost方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from future.backports.urllib import parse [as 別名]
# 或者: from future.backports.urllib.parse import splithost [as 別名]
def __init__(self, uri, transport=None, encoding=None, verbose=False,
allow_none=False, use_datetime=False, use_builtin_types=False):
# establish a "logical" server connection
# get the url
type, uri = urllib_parse.splittype(uri)
if type not in ("http", "https"):
raise IOError("unsupported XML-RPC protocol")
self.__host, self.__handler = urllib_parse.splithost(uri)
if not self.__handler:
self.__handler = "/RPC2"
if transport is None:
if type == "https":
handler = SafeTransport
else:
handler = Transport
transport = handler(use_datetime=use_datetime,
use_builtin_types=use_builtin_types)
self.__transport = transport
self.__encoding = encoding or 'utf-8'
self.__verbose = verbose
self.__allow_none = allow_none