基本认证(Basic Authorization)

----------------------------------


import arcpy
from base64 import encodestring

username = 'xxx'
password = 'xxx'

authorizationStr = encodestring('%s:%s' % (username, password))[:-1]
print('Basic %s' % authorizationStr)


req.add_header('Authorization','Basic %s' % authorizationStr)


-------------------------------------

posted @ 2019-08-29 14:36  ParamousGIS  阅读(631)  评论(0编辑  收藏  举报