POST
The POST method submits an entity to the specified resource, often causing a change in state or side effects on the server.
Unlike GET or PUT, POST is not idempotent. Multiple identical POST requests may result in multiple resources being created.
Bun / Node.js
Section titled “Bun / Node.js”const response = await fetch('https://api.example.com/data', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ key: 'value' })});Common Vulnerabilities (CWE/CVE Context)
Section titled “Common Vulnerabilities (CWE/CVE Context)”- CSRF (Cross-Site Request Forgery): If endpoints that use
POSTto change state aren’t protected by CSRF tokens orSameSitecookies, attackers can trick users into submitting malicious state changes.