---
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

- [Optimize Runtime Cache on Vercel](/kb/guide/optimize-runtime-cache-reads-on-vercel): Diagnose rising Runtime Cache usage, trace reads to tags and code paths, and reduce avoidable reads while checking write cost and origin traffic.
- [How to stop Vercel Functions from timing out](/kb/guide/what-can-i-do-about-vercel-serverless-functions-timing-out): Vercel Functions that time out usually trace back to a few causes. Learn how Fluid Compute fixes most of them and how to handle the edge cases.
- [The Complete Guide to Vercel Connect](/kb/guide/vercel-connect): Use Vercel Connect to call provider APIs like Slack, GitHub, Linear, Microsoft, Discord, Snowflake, and Salesforce from your agents and services with short-lived, scoped tokens instead of long-lived secrets.

## Reference Architecture

Choose a stack and work through the decisions behind it, with curated documentation, guides, templates, and courses to help you build.

- [Agent stack](/kb/architecture/agents): Build and operate agents with models, tools, and durable workflows.
- [Web applications](/kb/architecture/web): Choose rendering, data, authentication, and caching approaches.
- [Backends](/kb/architecture/backends): Choose a runtime, connect services, and run background work.

[Browse all stacks](/kb/architecture)

## Build with prompts

Build an app, extend an agent, or improve your project with ready-to-use prompts for your coding agent.

[Browse the prompt library](/kb/prompts) · [Read the Markdown index](/kb/prompts.md)
