@@ -216,7 +216,7 @@ function $HttpProvider() {
216
216
*
217
217
* @description
218
218
* The `$http` service is a core Angular service that facilitates communication with the remote
219
- * HTTP servers via browser's {@link https://developer.mozilla.org/en/xmlhttprequest
219
+ * HTTP servers via the browser's {@link https://developer.mozilla.org/en/xmlhttprequest
220
220
* XMLHttpRequest} object or via {@link http://en.wikipedia.org/wiki/JSONP JSONP}.
221
221
*
222
222
* For unit testing applications that use `$http` service, see
@@ -226,13 +226,13 @@ function $HttpProvider() {
226
226
* $resource} service.
227
227
*
228
228
* The $http API is based on the {@link ng.$q deferred/promise APIs} exposed by
229
- * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage,
230
- * it is important to familiarize yourself with these apis and guarantees they provide.
229
+ * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage
230
+ * it is important to familiarize yourself with these APIs and the guarantees they provide.
231
231
*
232
232
*
233
233
* # General usage
234
234
* The `$http` service is a function which takes a single argument — a configuration object —
235
- * that is used to generate an http request and returns a {@link ng.$q promise}
235
+ * that is used to generate an HTTP request and returns a {@link ng.$q promise}
236
236
* with two $http specific methods: `success` and `error`.
237
237
*
238
238
* <pre>
@@ -247,21 +247,21 @@ function $HttpProvider() {
247
247
* });
248
248
* </pre>
249
249
*
250
- * Since the returned value of calling the $http function is a Promise object , you can also use
250
+ * Since the returned value of calling the $http function is a `promise` , you can also use
251
251
* the `then` method to register callbacks, and these callbacks will receive a single argument –
252
- * an object representing the response. See the api signature and type info below for more
252
+ * an object representing the response. See the API signature and type info below for more
253
253
* details.
254
254
*
255
- * A response status code that falls in the [ 200, 300) range is considered a success status and
255
+ * A response status code between 200 and 299 is considered a success status and
256
256
* will result in the success callback being called. Note that if the response is a redirect,
257
257
* XMLHttpRequest will transparently follow it, meaning that the error callback will not be
258
258
* called for such responses.
259
259
*
260
260
* # Shortcut methods
261
261
*
262
- * Since all invocation of the $http service require definition of the http method and url and
263
- * POST and PUT requests require response body/ data to be provided as well, shortcut methods
264
- * were created to simplify using the api :
262
+ * Since all invocations of the $http service require passing in an HTTP method and URL, and
263
+ * POST/ PUT requests require request data to be provided as well, shortcut methods
264
+ * were created:
265
265
*
266
266
* <pre>
267
267
* $http.get('/someUrl').success(successCallback);
@@ -280,24 +280,24 @@ function $HttpProvider() {
280
280
*
281
281
* # Setting HTTP Headers
282
282
*
283
- * The $http service will automatically add certain http headers to all requests. These defaults
283
+ * The $http service will automatically add certain HTTP headers to all requests. These defaults
284
284
* can be fully configured by accessing the `$httpProvider.defaults.headers` configuration
285
285
* object, which currently contains this default configuration:
286
286
*
287
287
* - `$httpProvider.defaults.headers.common` (headers that are common for all requests):
288
288
* - `Accept: application/json, text/plain, * / *`
289
- * - `$httpProvider.defaults.headers.post`: (header defaults for HTTP POST requests)
289
+ * - `$httpProvider.defaults.headers.post`: (header defaults for POST requests)
290
290
* - `Content-Type: application/json`
291
- * - `$httpProvider.defaults.headers.put` (header defaults for HTTP PUT requests)
291
+ * - `$httpProvider.defaults.headers.put` (header defaults for PUT requests)
292
292
* - `Content-Type: application/json`
293
293
*
294
- * To add or overwrite these defaults, simply add or remove a property from this configuration
294
+ * To add or overwrite these defaults, simply add or remove a property from these configuration
295
295
* objects. To add headers for an HTTP method other than POST or PUT, simply add a new object
296
- * with name equal to the lower-cased http method name, e.g.
296
+ * with the lowercased HTTP method name as the key , e.g.
297
297
* `$httpProvider.defaults.headers.get['My-Header']='value'`.
298
298
*
299
- * Additionally, the defaults can be set at runtime via the `$http.defaults` object in a similar
300
- * fashion as described above .
299
+ * Additionally, the defaults can be set at runtime via the `$http.defaults` object in the same
300
+ * fashion.
301
301
*
302
302
*
303
303
* # Transforming Requests and Responses
@@ -307,36 +307,36 @@ function $HttpProvider() {
307
307
*
308
308
* Request transformations:
309
309
*
310
- * - if the `data` property of the request config object contains an object, serialize it into
310
+ * - If the `data` property of the request configuration object contains an object, serialize it into
311
311
* JSON format.
312
312
*
313
313
* Response transformations:
314
314
*
315
- * - if XSRF prefix is detected, strip it (see Security Considerations section below)
316
- * - if json response is detected, deserialize it using a JSON parser
315
+ * - If XSRF prefix is detected, strip it (see Security Considerations section below).
316
+ * - If JSON response is detected, deserialize it using a JSON parser.
317
317
*
318
318
* To globally augment or override the default transforms, modify the `$httpProvider.defaults.transformRequest` and
319
- * `$httpProvider.defaults.transformResponse` properties of the `$httpProvider` . These properties are by default an
319
+ * `$httpProvider.defaults.transformResponse` properties. These properties are by default an
320
320
* array of transform functions, which allows you to `push` or `unshift` a new transformation function into the
321
321
* transformation chain. You can also decide to completely override any default transformations by assigning your
322
322
* transformation functions to these properties directly without the array wrapper.
323
323
*
324
324
* Similarly, to locally override the request/response transforms, augment the `transformRequest` and/or
325
- * `transformResponse` properties of the config object passed into `$http`.
325
+ * `transformResponse` properties of the configuration object passed into `$http`.
326
326
*
327
327
*
328
328
* # Caching
329
329
*
330
- * To enable caching set the configuration property `cache` to `true`. When the cache is
330
+ * To enable caching, set the configuration property `cache` to `true`. When the cache is
331
331
* enabled, `$http` stores the response from the server in local cache. Next time the
332
332
* response is served from the cache without sending a request to the server.
333
333
*
334
334
* Note that even if the response is served from cache, delivery of the data is asynchronous in
335
335
* the same way that real requests are.
336
336
*
337
- * If there are multiple GET requests for the same url that should be cached using the same
337
+ * If there are multiple GET requests for the same URL that should be cached using the same
338
338
* cache, but the cache is not populated yet, only one request to the server will be made and
339
- * the remaining requests will be fulfilled using the response for the first request.
339
+ * the remaining requests will be fulfilled using the response from the first request.
340
340
*
341
341
* A custom default cache built with $cacheFactory can be provided in $http.defaults.cache.
342
342
* To skip it, set configuration property `cache` to `false`.
@@ -347,14 +347,14 @@ function $HttpProvider() {
347
347
* Before you start creating interceptors, be sure to understand the
348
348
* {@link ng.$q $q and deferred/promise APIs}.
349
349
*
350
- * For purposes of global error handling, authentication or any kind of synchronous or
350
+ * For purposes of global error handling, authentication, or any kind of synchronous or
351
351
* asynchronous pre-processing of request or postprocessing of responses, it is desirable to be
352
352
* able to intercept requests before they are handed to the server and
353
- * responses before they are handed over to the application code that
353
+ * responses before they are handed over to the application code that
354
354
* initiated these requests. The interceptors leverage the {@link ng.$q
355
- * promise APIs} to fulfil this need for both synchronous and asynchronous pre-processing.
355
+ * promise APIs} to fulfill this need for both synchronous and asynchronous pre-processing.
356
356
*
357
- * The interceptors are service factories that are registered with the $httpProvider by
357
+ * The interceptors are service factories that are registered with the ` $httpProvider` by
358
358
* adding them to the `$httpProvider.interceptors` array. The factory is called and
359
359
* injected with dependencies (if specified) and returns the interceptor.
360
360
*
@@ -474,7 +474,7 @@ function $HttpProvider() {
474
474
* When designing web applications, consider security threats from:
475
475
*
476
476
* - {@link http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx
477
- * JSON Vulnerability }
477
+ * JSON vulnerability }
478
478
* - {@link http://en.wikipedia.org/wiki/Cross-site_request_forgery XSRF}
479
479
*
480
480
* Both server and the client must cooperate in order to eliminate these threats. Angular comes
@@ -484,8 +484,8 @@ function $HttpProvider() {
484
484
* ## JSON Vulnerability Protection
485
485
*
486
486
* A {@link http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx
487
- * JSON Vulnerability } allows third party web-site to turn your JSON resource URL into
488
- * {@link http://en.wikipedia.org/wiki/JSON# JSONP JSONP} request under some conditions. To
487
+ * JSON vulnerability } allows third party website to turn your JSON resource URL into
488
+ * {@link http://en.wikipedia.org/wiki/JSONP JSONP} request under some conditions. To
489
489
* counter this your server can prefix all JSON requests with following string `")]}',\n"`.
490
490
* Angular will automatically strip the prefix before processing it as JSON.
491
491
*
@@ -506,20 +506,20 @@ function $HttpProvider() {
506
506
* ## Cross Site Request Forgery (XSRF) Protection
507
507
*
508
508
* {@link http://en.wikipedia.org/wiki/Cross-site_request_forgery XSRF} is a technique by which
509
- * an unauthorized site can gain your user's private data. Angular provides following mechanism
509
+ * an unauthorized site can gain your user's private data. Angular provides a mechanism
510
510
* to counter XSRF. When performing XHR requests, the $http service reads a token from a cookie
511
511
* (by default, `XSRF-TOKEN`) and sets it as an HTTP header (`X-XSRF-TOKEN`). Since only
512
512
* JavaScript that runs on your domain could read the cookie, your server can be assured that
513
513
* the XHR came from JavaScript running on your domain. The header will not be set for
514
514
* cross-domain requests.
515
515
*
516
516
* To take advantage of this, your server needs to set a token in a JavaScript readable session
517
- * cookie called `XSRF-TOKEN` on first HTTP GET request. On subsequent non-GET requests the
517
+ * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the
518
518
* server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure
519
- * that only JavaScript running on your domain could have read the token . The token must be
520
- * unique for each user and must be verifiable by the server (to prevent the JavaScript making
519
+ * that only JavaScript running on your domain could have sent the request . The token must be
520
+ * unique for each user and must be verifiable by the server (to prevent the JavaScript from making
521
521
* up its own tokens). We recommend that the token is a digest of your site's authentication
522
- * cookie with {@link http ://en.wikipedia.org/wiki/Rainbow_table salt for added security} .
522
+ * cookie with a {@link https ://en.wikipedia.org/wiki/Salt_(cryptography) salt} for added security.
523
523
*
524
524
* The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName
525
525
* properties of either $httpProvider.defaults, or the per-request config object.
@@ -736,7 +736,7 @@ function $HttpProvider() {
736
736
* @methodOf ng.$http
737
737
*
738
738
* @description
739
- * Shortcut method to perform `GET` request
739
+ * Shortcut method to perform `GET` request.
740
740
*
741
741
* @param {string } url Relative or absolute URL specifying the destination of the request
742
742
* @param {Object= } config Optional configuration object
@@ -749,7 +749,7 @@ function $HttpProvider() {
749
749
* @methodOf ng.$http
750
750
*
751
751
* @description
752
- * Shortcut method to perform `DELETE` request
752
+ * Shortcut method to perform `DELETE` request.
753
753
*
754
754
* @param {string } url Relative or absolute URL specifying the destination of the request
755
755
* @param {Object= } config Optional configuration object
@@ -762,7 +762,7 @@ function $HttpProvider() {
762
762
* @methodOf ng.$http
763
763
*
764
764
* @description
765
- * Shortcut method to perform `HEAD` request
765
+ * Shortcut method to perform `HEAD` request.
766
766
*
767
767
* @param {string } url Relative or absolute URL specifying the destination of the request
768
768
* @param {Object= } config Optional configuration object
@@ -775,7 +775,7 @@ function $HttpProvider() {
775
775
* @methodOf ng.$http
776
776
*
777
777
* @description
778
- * Shortcut method to perform `JSONP` request
778
+ * Shortcut method to perform `JSONP` request.
779
779
*
780
780
* @param {string } url Relative or absolute URL specifying the destination of the request.
781
781
* Should contain `JSON_CALLBACK` string.
@@ -790,7 +790,7 @@ function $HttpProvider() {
790
790
* @methodOf ng.$http
791
791
*
792
792
* @description
793
- * Shortcut method to perform `POST` request
793
+ * Shortcut method to perform `POST` request.
794
794
*
795
795
* @param {string } url Relative or absolute URL specifying the destination of the request
796
796
* @param {* } data Request content
@@ -804,7 +804,7 @@ function $HttpProvider() {
804
804
* @methodOf ng.$http
805
805
*
806
806
* @description
807
- * Shortcut method to perform `PUT` request
807
+ * Shortcut method to perform `PUT` request.
808
808
*
809
809
* @param {string } url Relative or absolute URL specifying the destination of the request
810
810
* @param {* } data Request content
@@ -856,7 +856,7 @@ function $HttpProvider() {
856
856
857
857
858
858
/**
859
- * Makes the request
859
+ * Makes the request.
860
860
*
861
861
* !!! ACCESSES CLOSURE VARS:
862
862
* $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests
0 commit comments