request-json
Advanced tools
Comparing version 0.4.6 to 0.4.7
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.6.3 | ||
// Generated by CoffeeScript 1.7.1 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var fs, parseBody, request, url; |
@@ -16,3 +16,3 @@ { | ||
], | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"homepage": "https://github.com/mycozycloud/request-json/", | ||
@@ -37,3 +37,3 @@ "bugs": { | ||
"dependencies": { | ||
"request": "2.21.0" | ||
"request": "2.34.0" | ||
}, | ||
@@ -40,0 +40,0 @@ "devDependencies": { |
@@ -21,4 +21,2 @@ ## About | ||
with Javascript: | ||
```javascript | ||
@@ -52,27 +50,4 @@ request = require('request-json'); | ||
with Coffeescript: | ||
```javascript | ||
request = require('request-json') | ||
client = request.newClient 'http://localhost:8888/' | ||
data = title: 'my title', content: 'my content' | ||
client.post 'posts/', data, (err, res, body) -> | ||
console.log response.statusCode | ||
client.get 'posts/', (err, res, body) -> | ||
console.log body.rows[0].title | ||
data = title: 'my new title' | ||
client.put 'posts/123/', data, (err, res, body) -> | ||
console.log response.statusCode | ||
client.del 'posts/123/', (err, res, body) -> | ||
console.log response.statusCode | ||
``` | ||
### Extra : files | ||
with Javascript: | ||
```javascript | ||
@@ -96,13 +71,2 @@ data = { | ||
with Coffeescript: | ||
```javascript | ||
data = name: "test" | ||
client.sendFile 'attachments/', './test.png', data, (err, res, body) -> | ||
console.log err if err | ||
client.saveFile 'attachments/test.png', './test-get.png', (err, res, body) -> | ||
console.log err if err | ||
``` | ||
sendFile can support file path, stream, array of file path and array of | ||
@@ -116,4 +80,2 @@ streams. Each file is stored with the key 'file + index' (file0, file1, | ||
with Javascript: | ||
```javascript | ||
@@ -127,9 +89,10 @@ client.setBasicAuth('john', 'secret'); | ||
## Who use it? | ||
with Coffeescript: | ||
request-json is downloaded more than 2000 times each month. Here are the | ||
companies which use it for their API clients: | ||
```javascript | ||
client.setBasicAuth 'john', 'secret' | ||
client.get 'private/posts/', (err, res, body) -> | ||
console.log body.rows[0].title | ||
``` | ||
* [Cozy Cloud](http://cozy.io) Personal Cloud Solutions | ||
* [Leank Kit](http://leankit.com/) Team Collaboration Solutions | ||
* [Forecast](http://forecast.io/) Weather Forecasting | ||
* [JS Report](http://jsreport.net/) Reporting Platform |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10548
94
+ Addedassert-plus@0.1.5(transitive)
+ Addedasync@0.9.2(transitive)
+ Addedaws-sign2@0.5.0(transitive)
+ Addedctype@0.5.3(transitive)
+ Addedform-data@0.1.4(transitive)
+ Addedhawk@1.0.0(transitive)
+ Addedhttp-signature@0.10.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedrequest@2.34.0(transitive)
+ Addedtldts@6.1.47(transitive)
+ Addedtldts-core@6.1.47(transitive)
+ Addedtough-cookie@5.0.0(transitive)
- Removedassert-plus@0.1.2(transitive)
- Removedasync@0.2.10(transitive)
- Removedaws-sign@0.3.0(transitive)
- Removedcookie-jar@0.3.0(transitive)
- Removedctype@0.5.2(transitive)
- Removedform-data@0.0.8(transitive)
- Removedhawk@0.13.1(transitive)
- Removedhoek@0.8.5(transitive)
- Removedhttp-signature@0.9.11(transitive)
- Removedjson-stringify-safe@4.0.0(transitive)
- Removedrequest@2.21.0(transitive)
Updatedrequest@2.34.0