当前位置: 首页>>代码示例>>Python>>正文


Python SimpleXMLRPCRequestHandler.parse_request方法代码示例

本文整理汇总了Python中SimpleXMLRPCServer.SimpleXMLRPCRequestHandler.parse_request方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleXMLRPCRequestHandler.parse_request方法的具体用法?Python SimpleXMLRPCRequestHandler.parse_request怎么用?Python SimpleXMLRPCRequestHandler.parse_request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimpleXMLRPCServer.SimpleXMLRPCRequestHandler的用法示例。


在下文中一共展示了SimpleXMLRPCRequestHandler.parse_request方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: parse_request

# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCRequestHandler import parse_request [as 别名]
         def parse_request(myself):
             if SimpleXMLRPCRequestHandler.parse_request(myself):
                 header = myself.headers.get('Authorization')
                 
                 if header == None:
                     username = None
                     password = None
                 else:                    
                     (basic, encoded) = \
                         header.split(' ', 2)
 
                     assert basic == 'Basic', 'Only basic authentication supported'
                     
                     (username,
                      password) = base64.b64decode(encoded).split(':', 2)
                 
                 if self.authenticate(username, password):
                     return True
                 else:
                     myself.send_response(401, 'Authentication failed')
                     myself.send_header('WWW-Authenticate',
                                        'Basic realm="XML-RPC"')
                     myself.end_headers()
                     
                     myself.wfile.write('Authentication failed.')
             
             return False
开发者ID:NETWAYS,项目名称:ingraph,代码行数:29,代码来源:xmlrpc.py

示例2: parse_request

# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCRequestHandler import parse_request [as 别名]
 def parse_request(self, *args):
     if SimpleXMLRPCRequestHandler.parse_request(self, *args):
         if self.authenticate():
             return True
         else:
             self.send_error(401, 'Authentication failed')
     return False
开发者ID:tianon,项目名称:debile,代码行数:9,代码来源:server.py

示例3: parse_request

# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCRequestHandler import parse_request [as 别名]
 def parse_request(self):
     if SimpleXMLRPCRequestHandler.parse_request(self):
         if self.authenticate(self.headers):
             return True
         else:
             self.send_error(401, "Authentication Failed")
             return False
开发者ID:gmurdocca,项目名称:fcombine,代码行数:9,代码来源:SecureXMLRPCServer.py

示例4: parse_request

# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCRequestHandler import parse_request [as 别名]
 def parse_request(request):
     if SimpleXMLRPCRequestHandler.parse_request(request):
         if self.authenticate(request.headers):
             return True
         else:
             request.send_error(401, "Authentication failed, Try again.")
     return False
开发者ID:zjicmDarkWing,项目名称:PythonNetwork,代码行数:9,代码来源:8_3a_xmlrpc_server_with_http_auth.py

示例5: parse_request

# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCRequestHandler import parse_request [as 别名]
 def parse_request(self):        
     if SimpleXMLRPCRequestHandler.parse_request(self):
         # next we authenticate
         if self.authenticate(self.headers):
             return True
         else:
             # if authentication fails, tell the client
             self.send_error(401, 'Authentication failed')
     return False
开发者ID:nicolargo,项目名称:pythonarena,代码行数:11,代码来源:server-xmlrpc-auth.py

示例6: parse_request

# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCRequestHandler import parse_request [as 别名]
 def parse_request(myself):
     # first, call the original implementation which returns
     # True if all OK so far
     if SimpleXMLRPCRequestHandler.parse_request(myself):
         # next we authenticate
         if self.authenticate(myself.headers):
             return True
         else:
             # if authentication fails, tell the client
             myself.send_error(401, 'Authentication failed')
     return False
开发者ID:fredstro,项目名称:mfdb,代码行数:13,代码来源:nosqlite.py

示例7: parse_request

# 需要导入模块: from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler [as 别名]
# 或者: from SimpleXMLRPCServer.SimpleXMLRPCRequestHandler import parse_request [as 别名]
 def parse_request(self):
 # parser request, get authentication header and send to authenticate().
     if SimpleXMLRPCRequestHandler.parse_request(self):
         if self.authenticate(self.headers):
             logging.info("Hass RequestHandler - Authentication success, request from %s", self.clientip)
             return True
         else:
             self.send_error(401, 'Authentication failed')
             return False
     else:
         logging.info("Hass RequestHandler - Authentication failed, request from %s", self.clientip)
         return False
开发者ID:yafish,项目名称:HASS-Project,代码行数:14,代码来源:Hass.py


注:本文中的SimpleXMLRPCServer.SimpleXMLRPCRequestHandler.parse_request方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。