开发者

303 Error while using xmlrpc in web2py for command line interface for a web application

I have the following functions defined in test.py file

@auth.requires_login()
def call():
    return service()

@service.xmlrpc
def time():
    import time
    return time.ctime()

and following in my db.py file

auth.settings.allow_basic_login = True  #for CLI access

When I execute the following commands in python shell :

server = ServerProxy( 'https://username:password@10.20.254.39/cloud_computing/test/call/xmlrpc' )
server.time()

I get the following error

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.6/xmlrpclib.py", line 1243, in request
    headers
xmlrpclib.ProtocolError: <ProtocolError for username:password@10.20.254.39/cloud_computing/test/call/xmlrpc: 303 开发者_StackOverflowSEE OTHER>

Am, I doing something wrong somewhere?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜