Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit d9d5347

Browse files
aostregajbdeboer
authored andcommitted
docs(http): spelling, grammar, capitalization, etc.
1 parent 38dffe7 commit d9d5347

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

src/ng/http.js

+44-44
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ function $HttpProvider() {
216216
*
217217
* @description
218218
* 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
220220
* XMLHttpRequest} object or via {@link http://en.wikipedia.org/wiki/JSONP JSONP}.
221221
*
222222
* For unit testing applications that use `$http` service, see
@@ -226,13 +226,13 @@ function $HttpProvider() {
226226
* $resource} service.
227227
*
228228
* 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.
231231
*
232232
*
233233
* # General usage
234234
* 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}
236236
* with two $http specific methods: `success` and `error`.
237237
*
238238
* <pre>
@@ -247,21 +247,21 @@ function $HttpProvider() {
247247
* });
248248
* </pre>
249249
*
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
251251
* 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
253253
* details.
254254
*
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
256256
* will result in the success callback being called. Note that if the response is a redirect,
257257
* XMLHttpRequest will transparently follow it, meaning that the error callback will not be
258258
* called for such responses.
259259
*
260260
* # Shortcut methods
261261
*
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:
265265
*
266266
* <pre>
267267
* $http.get('/someUrl').success(successCallback);
@@ -280,24 +280,24 @@ function $HttpProvider() {
280280
*
281281
* # Setting HTTP Headers
282282
*
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
284284
* can be fully configured by accessing the `$httpProvider.defaults.headers` configuration
285285
* object, which currently contains this default configuration:
286286
*
287287
* - `$httpProvider.defaults.headers.common` (headers that are common for all requests):
288288
* - `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)
290290
* - `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)
292292
* - `Content-Type: application/json`
293293
*
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
295295
* 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.
297297
* `$httpProvider.defaults.headers.get['My-Header']='value'`.
298298
*
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.
301301
*
302302
*
303303
* # Transforming Requests and Responses
@@ -307,36 +307,36 @@ function $HttpProvider() {
307307
*
308308
* Request transformations:
309309
*
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
311311
* JSON format.
312312
*
313313
* Response transformations:
314314
*
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.
317317
*
318318
* 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
320320
* array of transform functions, which allows you to `push` or `unshift` a new transformation function into the
321321
* transformation chain. You can also decide to completely override any default transformations by assigning your
322322
* transformation functions to these properties directly without the array wrapper.
323323
*
324324
* 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`.
326326
*
327327
*
328328
* # Caching
329329
*
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
331331
* enabled, `$http` stores the response from the server in local cache. Next time the
332332
* response is served from the cache without sending a request to the server.
333333
*
334334
* Note that even if the response is served from cache, delivery of the data is asynchronous in
335335
* the same way that real requests are.
336336
*
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
338338
* 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.
340340
*
341341
* A custom default cache built with $cacheFactory can be provided in $http.defaults.cache.
342342
* To skip it, set configuration property `cache` to `false`.
@@ -347,14 +347,14 @@ function $HttpProvider() {
347347
* Before you start creating interceptors, be sure to understand the
348348
* {@link ng.$q $q and deferred/promise APIs}.
349349
*
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
351351
* asynchronous pre-processing of request or postprocessing of responses, it is desirable to be
352352
* 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
354354
* 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.
356356
*
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
358358
* adding them to the `$httpProvider.interceptors` array. The factory is called and
359359
* injected with dependencies (if specified) and returns the interceptor.
360360
*
@@ -474,7 +474,7 @@ function $HttpProvider() {
474474
* When designing web applications, consider security threats from:
475475
*
476476
* - {@link http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx
477-
* JSON Vulnerability}
477+
* JSON vulnerability}
478478
* - {@link http://en.wikipedia.org/wiki/Cross-site_request_forgery XSRF}
479479
*
480480
* Both server and the client must cooperate in order to eliminate these threats. Angular comes
@@ -484,8 +484,8 @@ function $HttpProvider() {
484484
* ## JSON Vulnerability Protection
485485
*
486486
* 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
489489
* counter this your server can prefix all JSON requests with following string `")]}',\n"`.
490490
* Angular will automatically strip the prefix before processing it as JSON.
491491
*
@@ -506,20 +506,20 @@ function $HttpProvider() {
506506
* ## Cross Site Request Forgery (XSRF) Protection
507507
*
508508
* {@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
510510
* to counter XSRF. When performing XHR requests, the $http service reads a token from a cookie
511511
* (by default, `XSRF-TOKEN`) and sets it as an HTTP header (`X-XSRF-TOKEN`). Since only
512512
* JavaScript that runs on your domain could read the cookie, your server can be assured that
513513
* the XHR came from JavaScript running on your domain. The header will not be set for
514514
* cross-domain requests.
515515
*
516516
* 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
518518
* 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
521521
* 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.
523523
*
524524
* The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName
525525
* properties of either $httpProvider.defaults, or the per-request config object.
@@ -736,7 +736,7 @@ function $HttpProvider() {
736736
* @methodOf ng.$http
737737
*
738738
* @description
739-
* Shortcut method to perform `GET` request
739+
* Shortcut method to perform `GET` request.
740740
*
741741
* @param {string} url Relative or absolute URL specifying the destination of the request
742742
* @param {Object=} config Optional configuration object
@@ -749,7 +749,7 @@ function $HttpProvider() {
749749
* @methodOf ng.$http
750750
*
751751
* @description
752-
* Shortcut method to perform `DELETE` request
752+
* Shortcut method to perform `DELETE` request.
753753
*
754754
* @param {string} url Relative or absolute URL specifying the destination of the request
755755
* @param {Object=} config Optional configuration object
@@ -762,7 +762,7 @@ function $HttpProvider() {
762762
* @methodOf ng.$http
763763
*
764764
* @description
765-
* Shortcut method to perform `HEAD` request
765+
* Shortcut method to perform `HEAD` request.
766766
*
767767
* @param {string} url Relative or absolute URL specifying the destination of the request
768768
* @param {Object=} config Optional configuration object
@@ -775,7 +775,7 @@ function $HttpProvider() {
775775
* @methodOf ng.$http
776776
*
777777
* @description
778-
* Shortcut method to perform `JSONP` request
778+
* Shortcut method to perform `JSONP` request.
779779
*
780780
* @param {string} url Relative or absolute URL specifying the destination of the request.
781781
* Should contain `JSON_CALLBACK` string.
@@ -790,7 +790,7 @@ function $HttpProvider() {
790790
* @methodOf ng.$http
791791
*
792792
* @description
793-
* Shortcut method to perform `POST` request
793+
* Shortcut method to perform `POST` request.
794794
*
795795
* @param {string} url Relative or absolute URL specifying the destination of the request
796796
* @param {*} data Request content
@@ -804,7 +804,7 @@ function $HttpProvider() {
804804
* @methodOf ng.$http
805805
*
806806
* @description
807-
* Shortcut method to perform `PUT` request
807+
* Shortcut method to perform `PUT` request.
808808
*
809809
* @param {string} url Relative or absolute URL specifying the destination of the request
810810
* @param {*} data Request content
@@ -856,7 +856,7 @@ function $HttpProvider() {
856856

857857

858858
/**
859-
* Makes the request
859+
* Makes the request.
860860
*
861861
* !!! ACCESSES CLOSURE VARS:
862862
* $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests

0 commit comments

Comments
 (0)