MCPcopy Index your code
hub / github.com/Soundnode/soundnode-app / sendRequest

Function sendRequest

app/public/js/common/SC2apiService.js:101–118  ·  view source on GitHub ↗

* Utility method to send http request * @param {resource} resource - url part with resource name * @param {object} config - options for $http * @param {object} options - custom options (show loading, etc) * @return {promise}

(resource, config, options)

Source from the content-addressed store, hash-verified

99 * @return {promise}
100 */
101 function sendRequest(resource, config, options) {
102 config = config || {};
103 // Check if passed absolute url
104 if (resource.indexOf('http') === 0) {
105 config.url = resource;
106 } else {
107 config.url = SOUNDCLOUD_API_V2 + resource;
108 }
109 config.params = config.params || {};
110 config.params.oauth_token = $window.scAccessToken;
111
112 options = options || {};
113 if (options.loading !== false) {
114 $rootScope.isLoading = true;
115 }
116
117 return $http(config);
118 }
119
120 /**
121 * Response success handler

Callers 1

SC2apiService.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected