![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
form-data-body
Advanced tools
A tiny, dependency-free node module for generating a form's multipart/form-data body for a POST request.
A tiny, dependency-free node module for generating a form's multipart/form-data body for a POST request.
This is meant to be a simple, no frills module for generating a string to send as the body for a POST request simulating a form submission. If you need something with more bells and whistles, check out the form-data module.
npm install --save form-data-body
const formDataBody = require('form-data-body')
// Specify form fields
const fields = {
name: 'My test post',
description: 'This is just a test post',
items: ['First Item', 'Second Item'],
// Files should be an object with the name, type, and data set to strings
image: {
name: 'hello.jpg',
type: 'image/jpeg',
data: binaryImageData
}
}
const boundary = formDataBody.generateBoundary()
const header = {
'Content-Type': `multipart/form-data; boundary=${boundary}`
}
const body = formDataBody(fields, boundary)
----------------------------071517909670537006900435
Content-Disposition: form-data; name="name"
My test post
----------------------------071517909670537006900435
Content-Disposition: form-data; name="description"
This is just a test post
----------------------------071517909670537006900435
Content-Disposition: form-data; name="items[]"
First Item
----------------------------071517909670537006900435
Content-Disposition: form-data; name="items[]"
Second Item
----------------------------071517909670537006900435
Content-Disposition: form-data; name="image"; filename="hello.jpg"
Content-Type: image/jpeg
[BINARY IMAGE DATA]
----------------------------071517909670537006900435--
MIT. See the LICENSE file for more info.
FAQs
A tiny, dependency-free node module for generating a form's multipart/form-data body for a POST request.
The npm package form-data-body receives a total of 0 weekly downloads. As such, form-data-body popularity was classified as not popular.
We found that form-data-body demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.