使用esri/config这个类的request方法:
config.request.interceptors.push({ before: function(params) { //这里写请求之前的处理逻辑 }, // use the AfterInterceptorCallback to check if `ssl` is set to 'true' // on the response to the request, if it's set to 'false', change // the value to 'true' before returning the response after: function(response) { //这里写请求之后的处理逻辑 }, headers:{//增加请求的headers头 "X-OPENAPI-SubscriptionToken":"2889496a4f2c43af92857b41cb682fac" } });