document querystring apis
This commit is contained in:
parent
66aa9ce818
commit
6514a38162
6 changed files with 107 additions and 10 deletions
40
docs/buildQueryString.md
Normal file
40
docs/buildQueryString.md
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
# buildQueryString(object)
|
||||
|
||||
- [API](#api)
|
||||
- [How it works](#how-it-works)
|
||||
|
||||
---
|
||||
|
||||
### API
|
||||
|
||||
`querystring = m.buildQueryString(object)`
|
||||
|
||||
Argument | Type | Required | Description
|
||||
------------ | ------------------------------------------ | -------- | ---
|
||||
`object` | `Object` | Yes | A key-value map to be converted into a string
|
||||
**returns** | `String` | | A string representing the input object
|
||||
|
||||
[How to read signatures](signatures.md)
|
||||
|
||||
---
|
||||
|
||||
### How it works
|
||||
|
||||
The `m.buildQueryString` creates a querystring from an object. It's useful for manipulating URLs
|
||||
|
||||
```javascript
|
||||
var querystring = m.buildQueryString({a: 1, b: 2})
|
||||
|
||||
// querystring is "a=1&b=2"
|
||||
```
|
||||
|
||||
#### Deep data structures
|
||||
|
||||
Deep data structures are serialized in a way that is understood by popular web application servers such as PHP, Rails and ExpressJS
|
||||
|
||||
```javascript
|
||||
var querystring = m.buildQueryString({a: ["hello", "world"]})
|
||||
|
||||
// querystring is "a[0]=hello&a[1]=world"
|
||||
```
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue