From 4da666b8cd1332dc713583e4dbfe7de9958c7efd Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Wed, 19 Jun 2024 23:04:21 -0500 Subject: [PATCH] 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 * 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 * Update daprdocs/content/en/developing-applications/building-blocks/service-invocation/howto-invoke-discover-services.md Signed-off-by: Mark Fussell --------- Signed-off-by: Whit Waldo Signed-off-by: Mark Fussell Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Co-authored-by: Mark Fussell --- .../service-invocation/howto-invoke-discover-services.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/daprdocs/content/en/developing-applications/building-blocks/service-invocation/howto-invoke-discover-services.md b/daprdocs/content/en/developing-applications/building-blocks/service-invocation/howto-invoke-discover-services.md index 746fc071a0c..301c1542be9 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/service-invocation/howto-invoke-discover-services.md +++ b/daprdocs/content/en/developing-applications/building-blocks/service-invocation/howto-invoke-discover-services.md @@ -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 `.` format, use `checkout.production`.