Fix for #2423. request.data => body, params is used for querystrings (#2425)

* Fix for #2423. request.data is replaced by body, params is used for querystring interpolation.

* Updated documentation after code review by shadowhand and isiahmeadows

* Convert indentation to tabs

* Replacing m.request.data and m.jsonp.data with params or body.

* Update request.md


Co-authored-by: Isiah Meadows <contact@isiahmeadows.com>
This commit is contained in:
Erik Vullings 2019-06-11 01:36:33 +02:00 committed by Isiah Meadows
parent e82f6d00c2
commit 8a7eae00ed
7 changed files with 40 additions and 40 deletions

View file

@ -79,7 +79,7 @@ m("a[href='/Home']", {oncreate: m.route.link}, "Go to home page")
m.request({
method: "PUT",
url: "/api/v1/users/:id",
data: {id: 1, name: "test"}
params: {id: 1, name: "test"}
})
.then(function(result) {
console.log(result)
@ -93,7 +93,7 @@ m.request({
```javascript
m.jsonp({
url: "/api/v1/users/:id",
data: {id: 1},
params: {id: 1},
callbackKey: "callback",
})
.then(function(result) {