1

我有一个这样的网址:

http://site/account/login/

我想通过命令行来做到这一点,没有形式。

import requests
requests.get(url, auth=('username-goes-here', 'password-goes-here'))

但是如何使用 Cornice 在 Pyrmaid 中设计视图功能?

@user.get()
def login(request):

我根本没有看到auth元组出现requests.GET。我需要能够得到这些参数...

任何想法?

4

1 回答 1

4

您可以使用 HTTP 标头传递身份验证令牌。见http://cornice.readthedocs.org/en/latest/tutorial.html

于 2012-10-31T07:23:39.270 回答