@@ -434,7 +434,9 @@ function $HttpProvider() {
434
434
*
435
435
* ## General usage
436
436
* The `$http` service is a function which takes a single argument — a {@link $http#usage configuration object} —
437
- * that is used to generate an HTTP request and returns a {@link ng.$q promise}.
437
+ * that is used to generate an HTTP request and returns a {@link ng.$q promise} that is
438
+ * resolved (request success) or rejected (request failure) with a
439
+ * {@link ng.$http#$http-returns response} object.
438
440
*
439
441
* ```js
440
442
* // Simple GET request example:
@@ -450,24 +452,6 @@ function $HttpProvider() {
450
452
* });
451
453
* ```
452
454
*
453
- * The response object has these properties:
454
- *
455
- * - **data** – `{string|Object}` – The response body transformed with the transform
456
- * functions.
457
- * - **status** – `{number}` – HTTP status code of the response.
458
- * - **headers** – `{function([headerName])}` – Header getter function.
459
- * - **config** – `{Object}` – The configuration object that was used to generate the request.
460
- * - **statusText** – `{string}` – HTTP status text of the response.
461
- * - **xhrStatus** – `{string}` – Status of the XMLHttpRequest (`complete`, `error`, `timeout` or `abort`).
462
- *
463
- * A response status code between 200 and 299 is considered a success status and will result in
464
- * the success callback being called. Any response status code outside of that range is
465
- * considered an error status and will result in the error callback being called.
466
- * Also, status codes less than -1 are normalized to zero. -1 usually means the request was
467
- * aborted, e.g. using a `config.timeout`.
468
- * Note that if the response is a redirect, XMLHttpRequest will transparently follow it, meaning
469
- * that the outcome (success or error) will be determined by the final response status code.
470
- *
471
455
*
472
456
* ## Shortcut methods
473
457
*
@@ -853,8 +837,33 @@ function $HttpProvider() {
853
837
* - **responseType** - `{string}` - see
854
838
* [XMLHttpRequest.responseType](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#xmlhttprequest-responsetype).
855
839
*
856
- * @returns {HttpPromise } Returns a {@link ng.$q `Promise}` that will be resolved to a response object
857
- * when the request succeeds or fails.
840
+ * @returns {HttpPromise } A {@link ng.$q `Promise}` that will be resolved (request success)
841
+ * or rejected (request failure) with a response object.
842
+ *
843
+ * The response object has these properties:
844
+ *
845
+ * - **data** – `{string|Object}` – The response body transformed with
846
+ * the transform functions.
847
+ * - **status** – `{number}` – HTTP status code of the response.
848
+ * - **headers** – `{function([headerName])}` – Header getter function.
849
+ * - **config** – `{Object}` – The configuration object that was used
850
+ * to generate the request.
851
+ * - **statusText** – `{string}` – HTTP status text of the response.
852
+ * - **xhrStatus** – `{string}` – Status of the XMLHttpRequest
853
+ * (`complete`, `error`, `timeout` or `abort`).
854
+ *
855
+ *
856
+ * A response status code between 200 and 299 is considered a success status
857
+ * and will result in the success callback being called. Any response status
858
+ * code outside of that range is considered an error status and will result
859
+ * in the error callback being called.
860
+ * Also, status codes less than -1 are normalized to zero. -1 usually means
861
+ * the request was aborted, e.g. using a `config.timeout`. More information
862
+ * about the status might be available in the `xhrStatus` property.
863
+ *
864
+ * Note that if the response is a redirect, XMLHttpRequest will transparently
865
+ * follow it, meaning that the outcome (success or error) will be determined
866
+ * by the final response status code.
858
867
*
859
868
*
860
869
* @property {Array.<Object> } pendingRequests Array of config objects for currently pending
@@ -1104,8 +1113,9 @@ function $HttpProvider() {
1104
1113
*
1105
1114
* @param {string|TrustedObject } url Absolute or relative URL of the resource that is being requested;
1106
1115
* or an object created by a call to `$sce.trustAsResourceUrl(url)`.
1107
- * @param {Object= } config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage
1108
- * @returns {HttpPromise } Future object
1116
+ * @param {Object= } config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.
1117
+ * @returns {HttpPromise } A Promise that will be resolved or rejected with a response object.
1118
+ * See {@link ng.$http#$http-returns `$http()` return value}.
1109
1119
*/
1110
1120
1111
1121
/**
@@ -1117,8 +1127,9 @@ function $HttpProvider() {
1117
1127
*
1118
1128
* @param {string|TrustedObject } url Absolute or relative URL of the resource that is being requested;
1119
1129
* or an object created by a call to `$sce.trustAsResourceUrl(url)`.
1120
- * @param {Object= } config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage
1121
- * @returns {HttpPromise } Future object
1130
+ * @param {Object= } config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.
1131
+ * @returns {HttpPromise } A Promise that will be resolved or rejected with a response object.
1132
+ * See {@link ng.$http#$http-returns `$http()` return value}.
1122
1133
*/
1123
1134
1124
1135
/**
@@ -1130,8 +1141,9 @@ function $HttpProvider() {
1130
1141
*
1131
1142
* @param {string|TrustedObject } url Absolute or relative URL of the resource that is being requested;
1132
1143
* or an object created by a call to `$sce.trustAsResourceUrl(url)`.
1133
- * @param {Object= } config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage
1134
- * @returns {HttpPromise } Future object
1144
+ * @param {Object= } config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.
1145
+ * @returns {HttpPromise } A Promise that will be resolved or rejected with a response object.
1146
+ * See {@link ng.$http#$http-returns `$http()` return value}.
1135
1147
*/
1136
1148
1137
1149
/**
@@ -1172,8 +1184,9 @@ function $HttpProvider() {
1172
1184
*
1173
1185
* @param {string|TrustedObject } url Absolute or relative URL of the resource that is being requested;
1174
1186
* or an object created by a call to `$sce.trustAsResourceUrl(url)`.
1175
- * @param {Object= } config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage
1176
- * @returns {HttpPromise } Future object
1187
+ * @param {Object= } config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.
1188
+ * @returns {HttpPromise } A Promise that will be resolved or rejected with a response object.
1189
+ * See {@link ng.$http#$http-returns `$http()` return value}.
1177
1190
*/
1178
1191
createShortMethods ( 'get' , 'delete' , 'head' , 'jsonp' ) ;
1179
1192
@@ -1186,8 +1199,9 @@ function $HttpProvider() {
1186
1199
*
1187
1200
* @param {string } url Relative or absolute URL specifying the destination of the request
1188
1201
* @param {* } data Request content
1189
- * @param {Object= } config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage
1190
- * @returns {HttpPromise } Future object
1202
+ * @param {Object= } config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.
1203
+ * @returns {HttpPromise } A Promise that will be resolved or rejected with a response object.
1204
+ * See {@link ng.$http#$http-returns `$http()` return value}.
1191
1205
*/
1192
1206
1193
1207
/**
@@ -1199,8 +1213,9 @@ function $HttpProvider() {
1199
1213
*
1200
1214
* @param {string } url Relative or absolute URL specifying the destination of the request
1201
1215
* @param {* } data Request content
1202
- * @param {Object= } config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage
1203
- * @returns {HttpPromise } Future object
1216
+ * @param {Object= } config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.
1217
+ * @returns {HttpPromise } A Promise that will be resolved or rejected with a response object.
1218
+ * See {@link ng.$http#$http-returns `$http()` return value}.
1204
1219
*/
1205
1220
1206
1221
/**
@@ -1212,8 +1227,9 @@ function $HttpProvider() {
1212
1227
*
1213
1228
* @param {string } url Relative or absolute URL specifying the destination of the request
1214
1229
* @param {* } data Request content
1215
- * @param {Object= } config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage
1216
- * @returns {HttpPromise } Future object
1230
+ * @param {Object= } config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.
1231
+ * @returns {HttpPromise } A Promise that will be resolved or rejected with a response object.
1232
+ * See {@link ng.$http#$http-returns `$http()` return value}.
1217
1233
*/
1218
1234
createShortMethodsWithData ( 'post' , 'put' , 'patch' ) ;
1219
1235
0 commit comments