aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/http.js
diff options
context:
space:
mode:
authorArtur Ostrega2013-03-29 18:36:33 -0500
committerJames deBoer2013-04-11 14:09:12 -0700
commit187cd0a058b2aa266e964bba748469238cceb0e2 (patch)
tree08e04e942280b66bf99d01d0cc84bc6e08ecbf7b /src/ng/http.js
parent0c690af2fe8de6c933d245194fb937244a876490 (diff)
downloadangular.js-187cd0a058b2aa266e964bba748469238cceb0e2.tar.bz2
docs(http): spelling, grammar, capitalization, etc.
Conflicts: src/ng/http.js
Diffstat (limited to 'src/ng/http.js')
-rw-r--r--src/ng/http.js80
1 files changed, 40 insertions, 40 deletions
diff --git a/src/ng/http.js b/src/ng/http.js
index 6ee216ef..5fdc1a18 100644
--- a/src/ng/http.js
+++ b/src/ng/http.js
@@ -145,7 +145,7 @@ function $HttpProvider() {
*
* @description
* The `$http` service is a core Angular service that facilitates communication with the remote
- * HTTP servers via browser's {@link https://developer.mozilla.org/en/xmlhttprequest
+ * HTTP servers via the browser's {@link https://developer.mozilla.org/en/xmlhttprequest
* XMLHttpRequest} object or via {@link http://en.wikipedia.org/wiki/JSONP JSONP}.
*
* For unit testing applications that use `$http` service, see
@@ -155,13 +155,13 @@ function $HttpProvider() {
* $resource} service.
*
* The $http API is based on the {@link ng.$q deferred/promise APIs} exposed by
- * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage,
- * it is important to familiarize yourself with these apis and guarantees they provide.
+ * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage
+ * it is important to familiarize yourself with these APIs and the guarantees they provide.
*
*
* # General usage
* The `$http` service is a function which takes a single argument — a configuration object —
- * that is used to generate an http request and returns a {@link ng.$q promise}
+ * that is used to generate an HTTP request and returns a {@link ng.$q promise}
* with two $http specific methods: `success` and `error`.
*
* <pre>
@@ -176,21 +176,21 @@ function $HttpProvider() {
* });
* </pre>
*
- * Since the returned value of calling the $http function is a Promise object, you can also use
+ * Since the returned value of calling the $http function is a `promise`, you can also use
* the `then` method to register callbacks, and these callbacks will receive a single argument –
- * an object representing the response. See the api signature and type info below for more
+ * an object representing the response. See the API signature and type info below for more
* details.
*
- * A response status code that falls in the [200, 300) range is considered a success status and
+ * A response status code between 200 and 299 is considered a success status and
* will result in the success callback being called. Note that if the response is a redirect,
* XMLHttpRequest will transparently follow it, meaning that the error callback will not be
* called for such responses.
*
* # Shortcut methods
*
- * Since all invocation of the $http service require definition of the http method and url and
- * POST and PUT requests require response body/data to be provided as well, shortcut methods
- * were created to simplify using the api:
+ * Since all invocations of the $http service require passing in an HTTP method and URL, and
+ * POST/PUT requests require request data to be provided as well, shortcut methods
+ * were created:
*
* <pre>
* $http.get('/someUrl').success(successCallback);
@@ -209,25 +209,25 @@ function $HttpProvider() {
*
* # Setting HTTP Headers
*
- * The $http service will automatically add certain http headers to all requests. These defaults
+ * The $http service will automatically add certain HTTP headers to all requests. These defaults
* can be fully configured by accessing the `$httpProvider.defaults.headers` configuration
* object, which currently contains this default configuration:
*
* - `$httpProvider.defaults.headers.common` (headers that are common for all requests):
* - `Accept: application/json, text/plain, * / *`
* - `X-Requested-With: XMLHttpRequest`
- * - `$httpProvider.defaults.headers.post`: (header defaults for HTTP POST requests)
+ * - `$httpProvider.defaults.headers.post`: (header defaults for POST requests)
* - `Content-Type: application/json`
- * - `$httpProvider.defaults.headers.put` (header defaults for HTTP PUT requests)
+ * - `$httpProvider.defaults.headers.put` (header defaults for PUT requests)
* - `Content-Type: application/json`
*
- * To add or overwrite these defaults, simply add or remove a property from this configuration
+ * To add or overwrite these defaults, simply add or remove a property from these configuration
* objects. To add headers for an HTTP method other than POST or PUT, simply add a new object
- * with name equal to the lower-cased http method name, e.g.
+ * with the lowercased HTTP method name as the key, e.g.
* `$httpProvider.defaults.headers.get['My-Header']='value'`.
*
- * Additionally, the defaults can be set at runtime via the `$http.defaults` object in a similar
- * fassion as described above.
+ * Additionally, the defaults can be set at runtime via the `$http.defaults` object in the same
+ * fashion.
*
*
* # Transforming Requests and Responses
@@ -237,36 +237,36 @@ function $HttpProvider() {
*
* Request transformations:
*
- * - if the `data` property of the request config object contains an object, serialize it into
+ * - If the `data` property of the request configuration object contains an object, serialize it into
* JSON format.
*
* Response transformations:
*
- * - if XSRF prefix is detected, strip it (see Security Considerations section below)
- * - if json response is detected, deserialize it using a JSON parser
+ * - If XSRF prefix is detected, strip it (see Security Considerations section below).
+ * - If JSON response is detected, deserialize it using a JSON parser.
*
* To globally augment or override the default transforms, modify the `$httpProvider.defaults.transformRequest` and
- * `$httpProvider.defaults.transformResponse` properties of the `$httpProvider`. These properties are by default an
+ * `$httpProvider.defaults.transformResponse` properties. These properties are by default an
* array of transform functions, which allows you to `push` or `unshift` a new transformation function into the
* transformation chain. You can also decide to completely override any default transformations by assigning your
* transformation functions to these properties directly without the array wrapper.
*
* Similarly, to locally override the request/response transforms, augment the `transformRequest` and/or
- * `transformResponse` properties of the config object passed into `$http`.
+ * `transformResponse` properties of the configuration object passed into `$http`.
*
*
* # Caching
*
- * To enable caching set the configuration property `cache` to `true`. When the cache is
+ * To enable caching, set the configuration property `cache` to `true`. When the cache is
* enabled, `$http` stores the response from the server in local cache. Next time the
* response is served from the cache without sending a request to the server.
*
* Note that even if the response is served from cache, delivery of the data is asynchronous in
* the same way that real requests are.
*
- * If there are multiple GET requests for the same url that should be cached using the same
+ * If there are multiple GET requests for the same URL that should be cached using the same
* cache, but the cache is not populated yet, only one request to the server will be made and
- * the remaining requests will be fulfilled using the response for the first request.
+ * the remaining requests will be fulfilled using the response from the first request.
*
*
* # Response interceptors
@@ -318,7 +318,7 @@ function $HttpProvider() {
* When designing web applications, consider security threats from:
*
* - {@link http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx
- * JSON Vulnerability}
+ * JSON vulnerability}
* - {@link http://en.wikipedia.org/wiki/Cross-site_request_forgery XSRF}
*
* Both server and the client must cooperate in order to eliminate these threats. Angular comes
@@ -328,8 +328,8 @@ function $HttpProvider() {
* ## JSON Vulnerability Protection
*
* A {@link http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx
- * JSON Vulnerability} allows third party web-site to turn your JSON resource URL into
- * {@link http://en.wikipedia.org/wiki/JSON#JSONP JSONP} request under some conditions. To
+ * JSON vulnerability} allows third party website to turn your JSON resource URL into
+ * {@link http://en.wikipedia.org/wiki/JSONP JSONP} request under some conditions. To
* counter this your server can prefix all JSON requests with following string `")]}',\n"`.
* Angular will automatically strip the prefix before processing it as JSON.
*
@@ -350,19 +350,19 @@ function $HttpProvider() {
* ## Cross Site Request Forgery (XSRF) Protection
*
* {@link http://en.wikipedia.org/wiki/Cross-site_request_forgery XSRF} is a technique by which
- * an unauthorized site can gain your user's private data. Angular provides following mechanism
+ * an unauthorized site can gain your user's private data. Angular provides a mechanism
* to counter XSRF. When performing XHR requests, the $http service reads a token from a cookie
* called `XSRF-TOKEN` and sets it as the HTTP header `X-XSRF-TOKEN`. Since only JavaScript that
* runs on your domain could read the cookie, your server can be assured that the XHR came from
* JavaScript running on your domain.
*
* To take advantage of this, your server needs to set a token in a JavaScript readable session
- * cookie called `XSRF-TOKEN` on first HTTP GET request. On subsequent non-GET requests the
+ * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the
* server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure
- * that only JavaScript running on your domain could have read the token. The token must be
- * unique for each user and must be verifiable by the server (to prevent the JavaScript making
+ * that only JavaScript running on your domain could have sent the request. The token must be
+ * unique for each user and must be verifiable by the server (to prevent the JavaScript from making
* up its own tokens). We recommend that the token is a digest of your site's authentication
- * cookie with {@link http://en.wikipedia.org/wiki/Rainbow_table salt for added security}.
+ * cookie with a {@link https://en.wikipedia.org/wiki/Salt_(cryptography) salt} for added security.
*
*
* @param {object} config Object describing the request to be made and how it should be
@@ -540,7 +540,7 @@ function $HttpProvider() {
* @methodOf ng.$http
*
* @description
- * Shortcut method to perform `GET` request
+ * Shortcut method to perform `GET` request.
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {Object=} config Optional configuration object
@@ -553,7 +553,7 @@ function $HttpProvider() {
* @methodOf ng.$http
*
* @description
- * Shortcut method to perform `DELETE` request
+ * Shortcut method to perform `DELETE` request.
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {Object=} config Optional configuration object
@@ -566,7 +566,7 @@ function $HttpProvider() {
* @methodOf ng.$http
*
* @description
- * Shortcut method to perform `HEAD` request
+ * Shortcut method to perform `HEAD` request.
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {Object=} config Optional configuration object
@@ -579,7 +579,7 @@ function $HttpProvider() {
* @methodOf ng.$http
*
* @description
- * Shortcut method to perform `JSONP` request
+ * Shortcut method to perform `JSONP` request.
*
* @param {string} url Relative or absolute URL specifying the destination of the request.
* Should contain `JSON_CALLBACK` string.
@@ -594,7 +594,7 @@ function $HttpProvider() {
* @methodOf ng.$http
*
* @description
- * Shortcut method to perform `POST` request
+ * Shortcut method to perform `POST` request.
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {*} data Request content
@@ -608,7 +608,7 @@ function $HttpProvider() {
* @methodOf ng.$http
*
* @description
- * Shortcut method to perform `PUT` request
+ * Shortcut method to perform `PUT` request.
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {*} data Request content
@@ -660,7 +660,7 @@ function $HttpProvider() {
/**
- * Makes the request
+ * Makes the request.
*
* !!! ACCESSES CLOSURE VARS:
* $httpBackend, $config, $log, $rootScope, defaultCache, $http.pendingRequests