forwardemail / forwardemail/superagent
Adding an options argument to .field function to enable setting binary option in form-data
- Dominant language
- JavaScript
- Stars
- 16.6k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
In the function (file request-base.js)
RequestBase.prototype.field = function (name, value) {
.....
this._getFormData().append(name, value);
return this;
};
Actually Form data class has function to do append(name, value, options), which allow to add binary data, e.g. 'blob'.
So if you could change the function to be:
RequestBase.prototype.field = function (name, value, options) { // add options argument
.....
this._getFormData().append(name, value, options); // simply pass the options to form-data
return this;
};
Users could add binary data easily. I've tried locally and works fine.
Contributor guide
Research direction
Read request-base.js and the existing RequestBase.prototype.field implementation first. Check the surrounding request and form-data tests, then verify that an options argument reaches form-data append and supports binary data without changing existing calls.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 56/100