MCPcopy Create free account
hub / github.com/EricSimons/ionic-course / serverRequest

Function serverRequest

code/songhop/www/lib/angular/angular.js:9283–9302  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

9281 config.method = uppercase(config.method);
9282
9283 var serverRequest = function(config) {
9284 headers = config.headers;
9285 var reqData = transformData(config.data, headersGetter(headers), config.transformRequest);
9286
9287 // strip content-type if data is undefined
9288 if (isUndefined(reqData)) {
9289 forEach(headers, function(value, header) {
9290 if (lowercase(header) === 'content-type') {
9291 delete headers[header];
9292 }
9293 });
9294 }
9295
9296 if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) {
9297 config.withCredentials = defaults.withCredentials;
9298 }
9299
9300 // send request
9301 return sendReq(config, reqData, headers).then(transformResponse, transformResponse);
9302 };
9303
9304 var chain = [serverRequest, undefined];
9305 var promise = $q.when(config);

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