Service invocation supports passing of query strings/fragments in URL (#4217)

* Clarified that a query string or fragment can be appended to a service invocation request and it'll work without issue

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Update daprdocs/content/en/developing-applications/building-blocks/service-invocation/howto-invoke-discover-services.md

Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Update daprdocs/content/en/developing-applications/building-blocks/service-invocation/howto-invoke-discover-services.md

Signed-off-by: Mark Fussell <markfussell@gmail.com>

---------

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Mark Fussell <markfussell@gmail.com>
Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com>
Co-authored-by: Mark Fussell <markfussell@gmail.com>
This commit is contained in:
Whit Waldo 2024-06-19 23:04:21 -05:00 committed by GitHub
parent 751fb5e564
commit ae43d26627
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -410,6 +410,14 @@ Using CLI:
dapr invoke --app-id checkout --method checkout/100
```
#### Including a query string in the URL
You can also append a query string or a fragment to the end of the URL and Dapr will pass it through unchanged. This means that if you need to pass some additional arguments in your service invocation that aren't part of a payload or the path, you can do so by appending a `?` to the end of the URL, followed by the key/value pairs separated by `=` signs and delimited by `&`. For example:
```bash
curl 'http://dapr-app-id:checkout@localhost:3602/checkout/100?basket=1234&key=abc` -X POST
```
### Namespaces
When running on [namespace supported platforms]({{< ref "service_invocation_api.md#namespace-supported-platforms" >}}), you include the namespace of the target app in the app ID. For example, following the `<app>.<namespace>` format, use `checkout.production`.