forwardemail / forwardemail/superagent
No way to disable automated response parsing in node
- Dominant language
- JavaScript
- Stars
- 16.6k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
I'm piping the response to a file and have no need to parse it. I'm trying to disable the automatic parsing entirely to avoid the perf. hit but running into some problems.
``` javascript
var request = require('superagent');
request.parse = {};
```
I thought that would work based on the documentation but it didn't. The reason seems to be because [many parsers are hard-coded into the response handler](https://github.com/visionmedia/superagent/blob/e11119b0b6956e3a57d24c9093ee3057d33bde62/lib/node/index.js#L928).
This is a workaround but doesn't seem ideal.
``` javascript
// treats everything as binary
request.parse['application/x-www-form-urlencoded'] =
request.parse['application/json'] =
request.parse.text = request.parse.image;
```
Contributor guide
Assessment
This issue has not been assessed yet.