MCPcopy
hub / github.com/angular-ui/ui-router / serverRequest

Function serverRequest

test/angular/1.7/angular.js:13014–13033  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

13012 }
13013
13014 function serverRequest(config) {
13015 var headers = config.headers;
13016 var reqData = transformData(config.data, headersGetter(headers), undefined, config.transformRequest);
13017
13018 // strip content-type if data is undefined
13019 if (isUndefined(reqData)) {
13020 forEach(headers, function(value, header) {
13021 if (lowercase(header) === 'content-type') {
13022 delete headers[header];
13023 }
13024 });
13025 }
13026
13027 if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) {
13028 config.withCredentials = defaults.withCredentials;
13029 }
13030
13031 // send request
13032 return sendReq(config, reqData).then(transformResponse, transformResponse);
13033 }
13034
13035 function transformResponse(response) {
13036 // make a copy since the response must be cacheable

Callers

nothing calls this directly

Calls 6

transformDataFunction · 0.70
headersGetterFunction · 0.70
isUndefinedFunction · 0.70
forEachFunction · 0.70
lowercaseFunction · 0.70
sendReqFunction · 0.70

Tested by

no test coverage detected