基本认证(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)


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

你可能感兴趣的:(基本认证(Basic Authorization))