diff --git a/examples/Actor/README.md b/examples/Actor/README.md index 9cd8d4928..c2d2fc9d5 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 @@ -65,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) @@ -80,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