这是我连接到Box的代码,但是我无法使用box_storage.get_auth_session(data = data).来自rauth import OAuth2Service
box_storage = OAuth2Service(
name='Box',
client_id=CLIENT_ID,
client_secret=CLIENT_SECRET,
authorize_url='https://www.box.com/api/oauth2/authorize',
access_token_url='https://www.box.com/api/oauth2/token',
base_url='https://www.box.com/'
)
redirect_uri = 'http://127.0.0.1'
params = {
'redirect_uri': redirect_uri,
'response_type': 'code',
'state': 'good'
}
url = box_storage.get_authorize_url(**params)
data = {'code': 'foobar',
'grant_type': 'authorization_code',
'redirect_uri': redirect_uri}
session = box_storage.get_auth_session(data=data)
Run Code Online (Sandbox Code Playgroud)
这是我得到的错误:
Traceback (most recent call last):
File "C:\Users\rushd\Documents\Aptana Studio 3 Workspace\practice\box.py", line 24, in <module>
session = box_storage.get_auth_session(data=data)
File "C:\Users\rushd\Envs\practice\lib\site-packages\rauth\service.py", line 533, in get_auth_session
return self.get_session(self.get_access_token(method, **kwargs))
File "C:\Users\rushd\Envs\practice\lib\site-packages\rauth\service.py", line 519, in get_access_token
access_token, = process_token_request(r, decoder, key) …Run Code Online (Sandbox Code Playgroud) 我明白了什么ArrayList<String> list1 = new ArrayList<String>();,但哪个部分称为参数化类型?
赋值运算符左侧的类型变量或右侧的构造函数?当他们说参数化类型时,它们是指构造在角括号内定义参数化类型的方式,例如ArrayList<String>()?
因为我知道常规List = new List()没有参数化类型.
问题是:哪个部分是参数化类型?左侧或右侧:ArrayList<String> list1 or new ArrayList<String>();