From 8e06d490265c80eb64ba592fe1fb1cd5f1de0e37 Mon Sep 17 00:00:00 2001 From: Ricardo Niepel Date: Fri, 1 Oct 2021 13:51:58 +0200 Subject: [PATCH 1/2] Also use ActorClient as Dapr application --- examples/Actor/README.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/examples/Actor/README.md b/examples/Actor/README.md index 9cd8d4928..02b9db3ef 100644 --- a/examples/Actor/README.md +++ b/examples/Actor/README.md @@ -33,14 +33,8 @@ The `ActorClient` project shows how to make client calls for actor using Remotin Run the client project from `ActorClient` directory as: ```sh - dotnet run - ``` - - *Note: If you started the actor service with dapr port other than 3500, then set the environment variable DAPR_HTTP_PORT to the value of --dapr-http-port specified while starting the actor service before running the client in terminal.* - ``` - On Windows: set DAPR_HTTP_PORT= - On Linux, MacOS: export DAPR_HTTP_PORT= - ``` + dapr run --app-id actor_client dotnet run +``` ### Invoke Actor method without Remoting over Http From d085aceb60bf11e3c85f2434ba67207539196412 Mon Sep 17 00:00:00 2001 From: Ricardo Niepel Date: Fri, 1 Oct 2021 13:56:06 +0200 Subject: [PATCH 2/2] add sample.http to Actor sample --- examples/Actor/README.md | 18 ++++++++++++++++++ examples/Actor/sample.http | 7 +++++++ 2 files changed, 25 insertions(+) create mode 100644 examples/Actor/sample.http diff --git a/examples/Actor/README.md b/examples/Actor/README.md index 02b9db3ef..c2d2fc9d5 100644 --- a/examples/Actor/README.md +++ b/examples/Actor/README.md @@ -59,6 +59,16 @@ curl -X POST http://127.0.0.1:3500/v1.0/actors/DemoActor/abc/method/SaveData -d ``` +Or, using the Visual Studio Code [Rest Client Plugin](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) + +[sample.http](sample.http) + +```http +POST http://localhost:3500/v1.0/actors/DemoActor/abc/method/SaveData + +{ "PropertyA": "ValueA", "PropertyB": "ValueB" } +``` + **Get Data** Following curl call will get data for actor id "abc" (below calls on MacOs, Linux & Windows are exactly the same except for escaping quotes on Windows for curl) @@ -74,3 +84,11 @@ On Windows: ```sh curl -X POST http://127.0.0.1:3500/v1.0/actors/DemoActor/abc/method/GetData ``` + +Or, using the Visual Studio Code [Rest Client Plugin](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) + +[sample.http](sample.http) + +```http +GET http://localhost:3500/v1.0/actors/DemoActor/abc/method/GetData +``` diff --git a/examples/Actor/sample.http b/examples/Actor/sample.http new file mode 100644 index 000000000..fc632a4b7 --- /dev/null +++ b/examples/Actor/sample.http @@ -0,0 +1,7 @@ +POST http://localhost:3500/v1.0/actors/DemoActor/abc/method/SaveData + +{ "PropertyA": "ValueA", "PropertyB": "ValueB" } + +### + +GET http://localhost:3500/v1.0/actors/DemoActor/abc/method/GetData \ No newline at end of file