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

@ -204,7 +204,7 @@ In the refactored version, it's trivial to test whether `getFirstTen` has any of
Promises absorb other promises. Basically, this means you can never receive a Promise as an argument to `onFulfilled` or `onRejected` callbacks for `then` and `catch` methods. This feature allows us to flatten nested promises to make code more manageable.
```javascript
function searchUsers(q) {return m.request("/api/v1/users/search", {data: {q: q}})}
function searchUsers(q) {return m.request("/api/v1/users/search", {params: {q: q}})}
function getUserProjects(id) {return m.request("/api/v1/users/" + id + "/projects")}
// AVOID: pyramid of doom