mikeal/request — Issue #99: auto parse application/json
Author: secoif
Created: 2011-10-27 06:35:27+00:00
State: open

Is there a reason why request doesn't automatically JSON.parse the body if it detects the application/json content-type header (or perhaps if the url ends in .json?

eg:

```javascript
request('localhost:4000/datas.json'}, function(error, response, body) {
console.log(typeof body) // = string! but the server returned JSON
}
```
```javascript
request({url: 'datas.json', json: true}, function(error, response, body) {
console.log(typeof body) // = object. great, but the json:true could be inferred.
}
}
```