Merge pull request #606 from tracylv/master

Add a "POST" example for request
This commit is contained in:
Matthew Eernisse
2014-05-25 23:23:53 -07:00

View File

@@ -895,11 +895,19 @@ Sends requests to the given url sending any data if the method is POST or PUT
#####Examples
```
// 'GET' request
request({url: 'google.com', method: 'GET'}, function (err, data) {
if (err) { throw err; }
console.log(data)
})
// 'POST' request
request({url: 'google.com', data: geddy.uri.paramify({name: 'geddy', key: 'geddykey'}), headers: {'Content-Type': 'application/x-www-form-urlencoded'}, method: 'POST' }, function (err, data) {
if (err) { throw err; }
console.log(data)
})
```
* * *
@@ -1417,4 +1425,4 @@ Inflection returns an object that contains different inflections created from th
```
getInflections('user')
// => {filename: { ... }, constructor: { ... }, property: { ... }}
```
```