Skip to content

Commit

Permalink
Merge pull request #1314 from penance316/master
Browse files Browse the repository at this point in the history
Adding example of cancelling a POST request to readme
  • Loading branch information
nickuraltsev committed Jan 22, 2018
2 parents b004db4 + a8de2cf commit 604e8dd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,12 @@ axios.get('/user/12345', {
}
});

axios.post('/user/12345', {
name: 'new name'
}, {
cancelToken: source.token
})

// cancel the request (the message parameter is optional)
source.cancel('Operation canceled by the user.');
```
Expand Down

0 comments on commit 604e8dd

Please sign in to comment.