在Python中调用类时出错

时间:2014-07-30 15:02:01

标签: python python-3.x

我无法使用那里的例子 我正在测试这里的样本

http://cloud.verizon.com/documentation/AuthenticationRESTCallExample.htm

我通过使用(这是样本)来调用它们

secretKey="xxxxxxxxx"
accessKey="Xxxxxxxxx"
restVerb="GET"
apiResource="'https://api.cloud.verizon.com/api/cloud/vdisk-template/"
VzREST(secretKey,accessKey).request(restVerb,apiResource)

但是我收到了像

这样的错误
Traceback (most recent call last):
File "C:\Python34\admins\a1.py", line 176, in <module>
VzREST(secretKey,accessKey).request(restVerb,apiResource)
File "C:\Python34\admins\a1.py", line 171, in request
restVerb,apiResource=apiResource),data=data)
File "C:\Python34\admins\a1.py", line 103, in _reqREST
apiResource = self._stripAndEncodeApiResource(apiResource)
File "C:\Python34\admins\a1.py", line 45, in _stripAndEncodeApiResource
return re.sub(self._url, '', apiResource.encode('ascii', 'ignore'))
File "C:\Python34\lib\re.py", line 175, in sub
return _compile(pattern, flags).sub(repl, string, count)
TypeError: can't use a string pattern on a bytes-like object

我在这里犯的错误是什么?我是否错误地调用它(我在Python中不太好)

0 个答案:

没有答案