Skip to content
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
---
type: docs
title: "How-To: Handle large http body requests"
linkTitle: "HTTP request body size"
title: "How-To: Handle larger body requests"
linkTitle: "Request body size"
weight: 6000
description: "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 by defining:
- The `dapr.io/http-max-request-size` annotation, or
- The `--dapr-http-max-request-size` flag.
{{% alert title="Note" color="primary" %}}
The existing flag/annotation `dapr-http-max-request-size` has been deprecated and replaced with the below. It will be removed in the next release.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The existing flag/annotation `dapr-http-max-request-size` has been deprecated and replaced with the below. It will be removed in the next release.
The flag/annotation `dapr-http-max-request-size` has been deprecated and replaced with the `max-body-size` flag/annotation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikeee - Can you update the table in this article https://v1-16.docs.dapr.io/operations/support/breaking-changes-and-deprecations#Announced%20deprecations which is the list of deprecations. You can add announcement date of 1.14.0 and removal in 1.17.0. This is about preventing comments hidden in the docs about when etc.


Certification lifecycle only applies to built-in components and does not apply to [pluggable components]({{<ref "components-concept.md#Built-in-and-pluggable-components" >}}).
{{% /alert %}}

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.

{{< tabpane text=true >}}

<!--self hosted-->
{{% tab "Self-hosted" %}}

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

```bash
dapr run --dapr-http-max-request-size 16 node app.js
dapr run --max-body-size 16 node app.js
```
This tells Dapr to set maximum request body size to `16` MB.

{{% /tab %}}

<!--kubernetes-->
Expand Down Expand Up @@ -50,14 +54,16 @@ spec:
dapr.io/enabled: "true"
dapr.io/app-id: "myapp"
dapr.io/app-port: "8000"
dapr.io/http-max-request-size: "16"
dapr.io/max-body-size: "16"
#...
```

{{% /tab %}}

{{< /tabpane >}}

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

## Related links

[Dapr Kubernetes pod annotations spec]({{% ref arguments-annotations-overview.md %}})
Expand Down
Loading