MCPcopy Create free account
hub / github.com/angular-ui/ui-router / serverRequest

Function serverRequest

test/angular/1.5/angular.js:11804–11823  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

11802 }
11803
11804 function serverRequest(config) {
11805 var headers = config.headers;
11806 var reqData = transformData(config.data, headersGetter(headers), undefined, config.transformRequest);
11807
11808 // strip content-type if data is undefined
11809 if (isUndefined(reqData)) {
11810 forEach(headers, function(value, header) {
11811 if (lowercase(header) === 'content-type') {
11812 delete headers[header];
11813 }
11814 });
11815 }
11816
11817 if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) {
11818 config.withCredentials = defaults.withCredentials;
11819 }
11820
11821 // send request
11822 return sendReq(config, reqData).then(transformResponse, transformResponse);
11823 }
11824
11825 function transformResponse(response) {
11826 // 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