We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Form options not taking into consideration, options passed Sample Code:
const option = { headers: { Authorization: `Bearer ${jwtToken}`, }, payload: { 'content-type': 'multipart/form-data', }, } const form = formAutoContent( { file: fs.createReadStream(`./test/fixtures/test.txt`), }, option, )
Rest API call never will get JWT as it's not passed to request
The text was updated successfully, but these errors were encountered:
Wrong usage of the API:
const form = formAutoContent( { file: fs.createReadStream(`./test/fixtures/test.txt`), }) const myHeaders = { ...form.headers, // the content-type is already added automatically Authorization: `Bearer ${jwtToken}` } const thePayloadToSubmit = form.payload
The option object lets you to change the output field names:
const form = formAutoContent( { file: fs.createReadStream(`./test/fixtures/test.txt`), }, { payload: 'FOOO', headers: 'BAR' ) const myHeaders = { ...form.BAR, // the content-type is already added automatically Authorization: `Bearer ${jwtToken}` } const thePayloadToSubmit = form.FOOO
I think we may trigger an error when the input options does not contain a valid string value (as in this case, an object was provided)
options
Sorry, something went wrong.
No branches or pull requests
Form options not taking into consideration, options passed
Sample Code:
Rest API call never will get JWT as it's not passed to request
The text was updated successfully, but these errors were encountered: