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

(doc) sending data with $http --example #9046

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/ng/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ function $HttpProvider() {
* with two $http specific methods: `success` and `error`.
*
* ```js
* //Simple GET request example :
* $http({method: 'GET', url: '/someUrl'}).
* success(function(data, status, headers, config) {
* // this callback will be called asynchronously
Expand All @@ -236,7 +237,18 @@ function $HttpProvider() {
* // or server returns response with an error status.
* });
* ```
*
* //Simple POST request example (passing data) :
* $http({method: 'POST', data:{msg:'hello word!'}, url: '/someUrl'}).
* success(function(data, status, headers, config) {
* // this callback will be called asynchronously
* // when the response is available
* }).
* error(function(data, status, headers, config) {
* // called asynchronously if an error occurs
* // or server returns response with an error status.
* });
*
*
* 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
Expand Down