doc for dapr/dapr#3546 #1752

This commit is contained in:
Ian Luo 2021-08-31 13:47:01 +08:00
parent a584086177
commit 9cd767a46e
1 changed files with 21 additions and 0 deletions

View File

@ -111,6 +111,27 @@ curl http://localhost:3500/v1.0/invoke/cart/method/add -X DELETE
```
Dapr puts any payload returned by the called service in the HTTP response's body.
Furthermore, in order to avoid changing URL paths as much as possible, when make Dapr calls from user's code, Dapr provides a new way to help to integrate Dapr more easily:
1. Change the address in the URL to `localhost:<dapr-http-port>`.
2. Add a `dapr-app-id` header to specify the ID of the target service, or alternatively pass the ID via HTTP Basic Auth: `http://dapr-app-id:<service-id>@localhost:3500/path`.
For example, the following command
```bash
curl http://localhost:3500/v1.0/invoke/cart/method/add
```
is equivalent with
```bash
curl -H 'dapr-app-id: cart' 'http://localhost:3500/add' -X POST
```
or
```bash
curl 'http://dapr-app-id:cart@localhost:3500/add' -X POST
```
{{% /codetab %}}
{{% codetab %}}