How-To: Handle larger body requests

Configure http requests that are bigger than 4 MB

By default, Dapr has a limit for the request body size, set to 4MB. You can change this for both HTTP and gRPC requests by defining:

  • The dapr.io/max-body-size annotation, or
  • The --max-body-size flag.

When running in self-hosted mode, use the --max-body-size flag to configure Dapr to use non-default request body size:

dapr run --max-body-size 16Mi node app.js

On Kubernetes, set the following annotations in your deployment YAML:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp
  namespace: default
  labels:
    app: myapp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
      annotations:
        dapr.io/enabled: "true"
        dapr.io/app-id: "myapp"
        dapr.io/app-port: "8000"
        dapr.io/max-body-size: "16Mi"
#...

This tells Dapr to set the maximum request body size to 16 MB for both HTTP and gRPC requests.

Dapr Kubernetes pod annotations spec

Next steps

Install sidecar certificates
Last modified November 5, 2025: Add use-cases to the main page (#4937) (dcdc00f)