@@ -230,6 +230,7 @@ function $HttpProvider() {
230
230
* with two $http specific methods: `success` and `error`.
231
231
*
232
232
* ```js
233
+ * // Simple GET request example :
233
234
* $http({method: 'GET', url: '/someUrl'}).
234
235
* success(function(data, status, headers, config) {
235
236
* // this callback will be called asynchronously
@@ -241,6 +242,20 @@ function $HttpProvider() {
241
242
* });
242
243
* ```
243
244
*
245
+ * ```js
246
+ * // Simple POST request example (passing data) :
247
+ * $http({method: 'POST', url: '/someUrl', data:{msg:'hello word!'}}).
248
+ * success(function(data, status, headers, config) {
249
+ * // this callback will be called asynchronously
250
+ * // when the response is available
251
+ * }).
252
+ * error(function(data, status, headers, config) {
253
+ * // called asynchronously if an error occurs
254
+ * // or server returns response with an error status.
255
+ * });
256
+ * ```
257
+ *
258
+ *
244
259
* Since the returned value of calling the $http function is a `promise`, you can also use
245
260
* the `then` method to register callbacks, and these callbacks will receive a single argument –
246
261
* an object representing the response. See the API signature and type info below for more
0 commit comments