---
title: How do I get the raw body of a Serverless Function?
description: Learn how to disable body parsing for Vercel Serverless Functions to enable reading the raw data from a POST request.
url: /kb/guide/how-do-i-get-the-raw-body-of-a-serverless-function
canonical_url: "https://vercel.com/kb/guide/how-do-i-get-the-raw-body-of-a-serverless-function"
published: 2025-11-03
last_updated: 2025-11-10
authors: Lee Robinson
related: []
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---
<!-- docsgraph:related -->
## Related pages

> **For AI agents:** Follow these links to understand how this page connects to the rest of the Vercel ecosystem. For the full cross-link map (inbound, outbound, prerequisites, and semantic neighbors), see the .graph.md link below.

- [Getting Started](https://vercel.com/docs/functions/quickstart?from=related) — Build your first Vercel Function in a few steps.
- [Handling Node.js Request Bodies with Vercel](https://vercel.com/kb/guide/handling-node-request-body?from=related) — Parse Node.js request bodies for use inside Serverless Functions deployed with Vercel.
- [Node.js](https://vercel.com/docs/functions/runtimes/node-js?from=related) — Learn how to use the Node.js runtime to create functions and deploy Node.js servers on Vercel.
- [Functions](https://vercel.com/docs/functions?from=related) — Run server-side code on Vercel without managing a server.
- [Rust](https://vercel.com/docs/functions/runtimes/rust?from=related) — Build fast, memory-safe serverless functions with Rust on Vercel.
- [How do I bypass the 4.5MB body size limit of Vercel Serverless Functions?](https://vercel.com/kb/guide/how-to-bypass-vercel-body-size-limit-serverless-functions?from=related) — Learn how to deal with the body size limit of Serverless Functions on Vercel.
- [How do I debug a 502 error from a Vercel Serverless Function?](https://vercel.com/kb/guide/how-to-debug-a-502-error?from=related) — Information on how to debug a 502 error from a Vercel Serverless Function.
- [Why does my Serverless Function work locally but not when deployed?](https://vercel.com/kb/guide/why-does-my-serverless-function-work-locally-but-not-when-deployed?from=related) — Learn how to troubleshoot your Serverless Functions.
- [Processing Data Chunks](https://vercel.com/kb/guide/processing-data-chunks?from=related) — Learn how to create an API endpoint that processes data chunks.

Full cross-link map for this page: [/kb/guide/how-do-i-get-the-raw-body-of-a-serverless-function.graph.md](/kb/guide/how-do-i-get-the-raw-body-of-a-serverless-function.graph.md)
<!-- /docsgraph:related -->


You can use Vercel Serverless Functions to receive webhooks from third-party services like Stripe. Certain providers require access to the raw body inside the function to validate the signature from the request.

## Accessing the raw body from the request

```javascript
export async function POST(request: Request) {
  const rawBody = await request.text()
  return Response.json({ rawBody })
}
```

## Testing your function locally

You can verify your function can accept and parse raw bodies locally:

1. Start your local development server with `vercel dev` (or `next dev`).
   
2. In another terminal window, run the `cURL` command below.
   

```bash
curl -X POST -H "Content-Type: text/plain" --data "This is raw data" http://localhost:3000/api/test
```

You should see a response like `{"rawBody": "This is raw data"}`.