---
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: "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
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---

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"}`.

## Related Documentation

- [Vercel Functions](/docs/functions)

## More Vercel Functions guides

- [Deploy Rust on Vercel with Docker](/kb/guide/deploy-rust-on-vercel-with-docker): Build a Rust application with Axum and Docker, then deploy it to Vercel Functions. Learn how to configure environment variables, managed storage, and preview deployments for your project.
- [Vercel vs Railway](/kb/guide/vercel-vs-railway): A detailed guide to Vercel vs Railway: serverless vs always-on containers, container images from a Dockerfile, framework-defined infrastructure, AI infrastructure, global CDN, security, and when to choose each platform for your project.
- [Vercel vs Render](/kb/guide/vercel-vs-render): A detailed guide to Vercel vs Render: compute models, AI infrastructure, Docker and container image support, background workers, and when to choose each platform for your project.