def auth_server():
username = request.forms.get('username')
if username == 'user_ok':
return {'access_token': 'my-nifty-access-token'}
elif username == 'auth_fail':
response.status = 400
return {'error': 'errored with HTTP 400 on request'}
elif username == 'create_fail':
return {'access_token': 'the-token-with-which-create-will-fail'}
elif username == 'delete_fail':
return {'access_token': 'the-token-with-which-delete-will-fail'}
elif username == 'empty_page':
return {'access_token': 'the-token-which-causes-an-empty-page'}
else:
return {}
评论列表
文章目录