dotnet-sdk
dotnet-sdk copied to clipboard
Invoke with method containing query string needs to be /?
Expected Behavior
The method parameter passed to DaprClient.InvokeMethod***Async with query parameters should work with 'method?param1=123'.
Actual Behavior
Using 'method?param1=123' leads to an internal error reported back
Using the method parameter method/?param1=123' works.
Steps to Reproduce the Problem
CLI version: 1.7.1 Runtime version: 1.7.4
@penfold - Thanks for opening this issue! Can you please paste the error you get here?
@penfold - I tried to repro this and found it works fine for me:
Calls:
➜ ~/Projects/TestBed/TestBed.Web git:(master) ✗
$ curl 'http://localhost:22222/api/service/testParam?test=123'
➜ ~/Projects/TestBed/TestBed.Web git:(master) ✗
$ curl 'http://localhost:60541/v1.0/invoke/testbed/method/api/service/testParam?test=456'
App response:
== APP == info: TestBed.Web.Controllers.ServiceController[0]
== APP == Received: 123
== APP == info: TestBed.Web.Controllers.ServiceController[0]
== APP == Received: 456
Code:
[HttpGet("testParam")]
public Task TestParam([FromQuery] string test)
{
logger.LogInformation($"Received: {test}");
return Task.CompletedTask;
}
What does your endpoint setup look like?
My endpoint was a POST with boolean query params and a JSON body.
Called from a console app using DaprClient - not curl.
All using .net 6.
I'll add an exact repo when I'm back from annual leave next week.
Thanks.
@penfold - Are you able to provide a repro for this?
Having the same issue but with the following query string
filter[policy]=12345 @halspang
@penfold @ekjuanrejon Are you still running into this issue? I've successfully used both method?name=value and method/?name=value in InvokeMethodAsync() calls, for both GET and POST methods, with the latest (1.11.0) version of the Dapr Client SDK.
If either of you are still having issues, could you post a more complete repro?
Reverted to using http client.