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