请求完成的处理函数

@inner
@param {Object} requester 请求对象
422158
function finish(requester) {
        var orgHeaders = normal(requester.res.headers);
        // 恢复当前的请求上下文

        var context = requester.ctx;
        if (app.revertContext(context)) {
            // 透传响应头信息
            var res = context.res;
            headers.forEach(function (name) {
                if (orgHeaders[name]) {
                    // 直接覆盖
                    res.set(name, orgHeaders[name]);
                }
            });
        }
        // Dispose
        requester.ctx = context = null;
    }
1333765
function (request) {
            var transport;
            if (request.jsonp) {
                transport = this.__jsonp;
            } else if (ariaUtilsType.isHTMLElement(request.form)) {
                transport = this.__iframe;
            } else {
                transport = this._getTransport(request.url, Aria.$frameworkWindow
                        ? Aria.$frameworkWindow.location
                        : null);
            }

            var instance = Aria.getClassRef(transport);
            var args = {
                req : request,
                transport : {
                    classpath : transport,
                    instance : instance
                }
            };

            if (!instance) {
                Aria.load({
                    classes : [transport],
                    oncomplete : {
                        fn : this._asyncRequest,
                        args : args,
                        scope : this
                    }
                });
            } else {
                this._asyncRequest(args);
            }
        }
1083450
function (req, res, err) {
    if (isResHeaderSent(res)) { //request has already been closed
        //console.log('cannot throw error on an already closed request')
        return;
    }
    if (typeof (err.stack) == 'string') {
        err.stack = err.stack.split(' at '); //stack string to array
    }
    var isHtml = new reqres(res, req).isHtml();
    if (isHtml) {
        ack.router().htmlCloseError({ debug: isProductionMode })(err, req, res);
    }
    else {
        ack.router().jsonCloseError({ debug: isProductionMode })(err, req, res);
    }
    resMarkClosed(res);
}
1198043
function(url, config) {
        config = config || {}

        // 获取头信息
        let realReq = setRequest(ctx, url, config);

        // 扩展请求头信息
        let headersObj = Object.assign({}, realReq.headers, config.headers)

        // 获取请求数据配置
        let requestData = parseData(ctx, config);

        // 请求request的最终配置
        let requestOpt = Object.assign({}, options, {
          uri: realReq.uri,
          method: realReq.method,
          headers: headersObj,
          timeout: undefined,
          gzip: false,
          encoding: null
        }, requestData, config.conf);

        // 发送请求前的钩子，可以对requestjs的参数自定义任何操作
        config.onBeforeRequest && config.onBeforeRequest.call(ctx, proxyName, requestOpt)

        return request(ctx, {
          needPipeRes: true
        }, requestOpt);
      }
1243945
private HttpExecutor createHttpExecutor(RequestMethodHolder requestMethodHolder) {
    HttpExecutor executor;
    if (customHttpClient == null) {
      executor = executorFactory.getHttpExecutor(requestMethodHolder.getBodyType());
    } else {
      executor = executorFactory.getHttpExecutor(requestMethodHolder.getBodyType(), customHttpClient);
    }
    executor.setCharset(charset);
    executor.setProxy(this.proxy);
    executor.setTimeout(timeout.socketTimeout, timeout.connectTimeout);
    return executor;
  }
1144661
function(url, processRes){
                var self = this;

                //iterators
                var key, header;

                var method      = data.method || 'get';
                var async       = data.sync !== true;
                var request     = new XMLHttpRequest();
                var _data       = data.data;
                var body        = data.body;
                var contentType = this.header('Content-Type');
                var timeout     = data.timeout;
                var timeoutId;
                var isUrlEncoded;
                var openParams;

                //guess content type
                if(!contentType && _data && _dataInBody()){
                    this.header('Content-Type', 'application/x-www-form-urlencoded;charset=utf-8');
                    contentType = this.header('Content-Type');
                }

                //if data is used in body, it needs some modifications regarding the content type
                if(_data && _dataInBody()){
                    if(typeof body !== 'string'){
                        body = '';
                    }

                    if(contentType.indexOf('json') > -1){
                        try {
                            body = JSON.stringify(_data);
                        } catch(e){
                            throw new TypeError('Unable to stringify body\'s content : ' + e.name);
                        }
                    } else {
                        isUrlEncoded = contentType && contentType.indexOf('x-www-form-urlencoded') > 1;
                        for(key in _data){
                            if(isUrlEncoded){
                                body += encodeURIComponent(key) + '=' + encodeURIComponent(_data[key]) + '&';
                            } else {
                                body += key + '=' + _data[key] + '\n\r';
                            }
                        }
                    }
                }

                //open the XHR request
                openParams = [method, url, async];
                if(data.auth){
                    openParams.push(data.auth.user);
                    openParams.push(data.auth.passwd);
                }
                request.open.apply(request, openParams);

                //set the headers
                for(header in data.headers){
                    request.setRequestHeader(header, data.headers[header]);
                }

                //bind events
                request.onprogress = function(e){
                    if (e.lengthComputable) {
                        self.trigger('progress', e.loaded / e.total);
                    }
                };

                request.onload = function onRequestLoad(){
                    var response = request.responseText;

                    if (timeoutId) {
                        clearTimeout(timeoutId);
                    }
                    if(this.status >= 200 && this.status < 300){
                        if(typeof processRes === 'function'){
                            response = processRes(response);
                        }
                        self.trigger('success', response);
                    }

                    self.trigger(this.status, response);

                    self.trigger('end', response);
                };

                request.onerror = function onRequestError (err){
                    if (timeoutId) {
                        clearTimeout(timeoutId);
                    }
                    self.trigger('error', err, arguments);
                };

                //sets the timeout
                if (timeout) {
                    timeoutId = setTimeout(function() {
                        self.trigger('timeout', {
                            type: 'timeout',
                            expiredAfter: timeout
                        }, request, arguments);
                        request.abort();
                    }, timeout);
                }

                //send the request
                request.send(body);
            }
1299049
public static Map<String,String> buildHeaders( String reqCorsHeader, String requestUri ) {

		Map<String,String> result = new LinkedHashMap<> ();
		result.put( CORS_ALLOW_ORIGIN, requestUri );
		result.put( CORS_ALLOW_METHODS, VALUE_ALLOWED_METHODS );
		result.put( CORS_ALLOW_CREDENTIALS, VALUE_ALLOW_CREDENTIALS );

		if( ! Utils.isEmptyOrWhitespaces( reqCorsHeader ))
			result.put( CORS_ALLOW_HEADERS, reqCorsHeader );

		return result;
	}
559905
function (requestV1) {
        var self = this,
            request = {},
            retainEmpty = self.options.retainEmptyValues,
            units = ['auth', 'method', 'header', 'body', 'url'];

        units.forEach(function (unit) {
            request[unit] = self[unit](requestV1);
        });

        if (requestV1.description) { request.description = requestV1.description; }
        else if (retainEmpty) { request.description = null; }

        return request;
    }
695681
function createSelectionTrimmer(methodName) {
        return createEntryPointFunction(
            function(session, characterOptions) {
                var trimmed = false;
                this.changeEachRange(function(range) {
                    trimmed = range[methodName](characterOptions) || trimmed;
                });
                return trimmed;
            }
        );
    }
720509
private void populateRequestHeaders(HttpURLConnection httpUrlConnection, Map<String, String> requestHeaders) {
		
		Set<String> keySet = requestHeaders.keySet();
		Iterator<String> keySetIterator = keySet.iterator();
		while (keySetIterator.hasNext()) {
			String key = keySetIterator.next();
			String value = requestHeaders.get(key);
			httpUrlConnection.setRequestProperty(key, value);
		}
		
		PropertyHelper propertyHelper = PropertyHelper.getInstance();
		String requestSource = propertyHelper.getRequestSource() + propertyHelper.getVersion();
		if(propertyHelper.getRequestSourceHeader() != null){
			httpUrlConnection.setRequestProperty(propertyHelper.getRequestSourceHeader(), requestSource);
		}
		

	}
88785
private static void parseAST(String[] srcFiles, Charset srcCharset,
            String[] classPathEntries, FileASTRequestor requestor) {
        ASTParser parser = ASTParser.newParser(AST.JLS8);
        Map<String, String> options = JavaCore.getOptions();
        JavaCore.setComplianceOptions(JavaCore.VERSION_1_8, options);
        parser.setCompilerOptions(options);
        parser.setKind(ASTParser.K_COMPILATION_UNIT);
        parser.setResolveBindings(true);
        parser.setBindingsRecovery(true);
        parser.setEnvironment(classPathEntries, null, null, true);
        String[] srcEncodings = new String[srcFiles.length];
        for (int i = 0; i < srcEncodings.length; i++) {
            srcEncodings[i] = srcCharset.name();
        }
        parser.createASTs(
                srcFiles, srcEncodings, new String[]{}, requestor, null);
    }
383076
function URLHelper(baseUrl) {
    var _this3 = this;

    _classCallCheck(this, URLHelper);

    _defineProperty(this, "baseUrl", '');

    _defineProperty(this, "search", {});

    var t = decodeURI(baseUrl).split('?');
    this.baseUrl = t[0];

    if (t[1]) {
      t[1].split('&').forEach(function (v) {
        var t2 = v.split('=');
        _this3.search[t2[0]] = t2[1] == null ? '' : decodeURIComponent(t2[1]);
      });
    }
  }
830925
function requestBody(request, onEnd) {
    var fullBody = '';
    request.on('data', function(d) {
        fullBody += d.toString();
    });
    request.on('end', function() {
        onEnd(querystring.parse(fullBody));
    });
}
650438
public static void initServletRequest(ServletRequest servletRequest, TemplatedURLFormatter formatter)
    {
        assert servletRequest != null : "The ServletRequest cannot be null.";

        if (servletRequest == null) {
            throw new IllegalArgumentException("The ServletRequest cannot be null.");
        }

        servletRequest.setAttribute(TEMPLATED_URL_FORMATTER_ATTR, formatter);
    }
129213
function( mockHandler, requestSettings ) {
			if ( mockHandler.logging === false ||
				 ( typeof mockHandler.logging === 'undefined' && $.mockjaxSettings.logging === false ) ) {
				return;
			}
			if ( window.console && console.log ) {
				var message = 'MOCK ' + requestSettings.type.toUpperCase() + ': ' + requestSettings.url;
				var request = $.extend({}, requestSettings);

				if (typeof console.log === 'function') {
					console.log(message, request);
				} else {
					try {
						console.log( message + ' ' + JSON.stringify(request) );
					} catch (e) {
						console.log(message);
					}
				}
			}
		}
1311662
function(updater) {
        for (var i = 0; i < buffer.length; ++i) {
          var _cfg = updater(buffer[i].config);
          if (_cfg !== false)
            retryHttpRequest(_cfg, buffer[i].deferred);
        }
        buffer = [];
      }
1338398
function(request, response, error)
	{
		if(this._swf)
		{
			if(error)
			{
			}
			else
			{
				var i;
				if(this._seriesFunctions)
				{
					var count = this._seriesFunctions.length;
					for(i = 0; i < count; i++)
					{
						YAHOO.widget.Chart.removeProxyFunction(this._seriesFunctions[i]);
					}
					this._seriesFunctions = null;
				}
				this._seriesFunctions = [];

				//make a copy of the series definitions so that we aren't
				//editing them directly.
				var dataProvider = [];	
				var seriesCount = 0;
				var currentSeries = null;
				if(this._seriesDefs !== null)
				{
					seriesCount = this._seriesDefs.length;
					for(i = 0; i < seriesCount; i++)
					{
						currentSeries = this._seriesDefs[i];
						var clonedSeries = {};
						for(var prop in currentSeries)
						{
							if(YAHOO.lang.hasOwnProperty(currentSeries, prop))
							{
								if(prop == "style")
								{
									if(currentSeries.style !== null)
									{
										clonedSeries.style = YAHOO.lang.JSON.stringify(currentSeries.style);
									}
								}

								else if(prop == "labelFunction")
								{
									if(currentSeries.labelFunction !== null)
									{	
										clonedSeries.labelFunction = YAHOO.widget.Chart.getFunctionReference(currentSeries.labelFunction);
										this._seriesFunctions.push(clonedSeries.labelFunction);
									}
								}

								else if(prop == "dataTipFunction")
								{
									if(currentSeries.dataTipFunction !== null)
									{
										clonedSeries.dataTipFunction = YAHOO.widget.Chart.getFunctionReference(currentSeries.dataTipFunction);
										this._seriesFunctions.push(clonedSeries.dataTipFunction);
									}	
								}
								
								else if(prop == "legendLabelFunction")
								{
									if(currentSeries.legendLabelFunction !== null)
									{
										clonedSeries.legendLabelFunction = YAHOO.widget.Chart.getFunctionReference(currentSeries.legendLabelFunction);
										this._seriesFunctions.push(clonedSeries.legendLabelFunction); 
									}	
								}								

								else
								{
									clonedSeries[prop] = currentSeries[prop];
								}
							}
						}
						dataProvider.push(clonedSeries);
					}
				}

				if(seriesCount > 0)
				{
					for(i = 0; i < seriesCount; i++)
					{
						currentSeries = dataProvider[i];
						if(!currentSeries.type)
						{
							currentSeries.type = this._type;
						}
						currentSeries.dataProvider = response.results;
					}
				}
				else
				{
					var series = {type: this._type, dataProvider: response.results};
					dataProvider.push(series);
				}
				try
				{
					if(this._swf.setDataProvider) this._swf.setDataProvider(dataProvider);
				}
				catch(e)
				{
					this._swf.setDataProvider(dataProvider);
				}
			}
		}
	}