在c# Web API -我如何获得用户和传递从Python HTTPBasicAuth
本文关键字:HTTPBasicAuth Python 用户 何获得 Web API | 更新日期: 2023-09-27 18:17:11
在下面的Python调用中,我如何在c# Web API端从Python HTTPBasicAuth获得User和Pass ?
from requests.auth import HTTPBasicAuth
s = requests.Session()
# Make the initial authentication request from a session object
s.get('https://omg.wtf/user', auth=HTTPBasicAuth('user', 'pass'))
# All subsequent requests from that session will include any cookies set in the initial response
r = s.get('http://omg.wtf/911')
https://msdn.microsoft.com/en-us/library/system.web.httprequest(v=vs.110).aspx
HttpRequest报头集合应该包含基本的验证数据,如果它是纯文本发送的