2012-08-25 33 views
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可言。我需要能夠得到這些參數...

任何想法?

+0

只是一種猜測,但請求可能放入基本認證頭的PARAMS發送請求之前,所以在金字塔邊,檢查request.headers –

+0

爲檐口教程包含示例性驗證,說明如何來驗證請求... – Ramonster

回答