REST-API for code assignment in .NET
The assignment is to create a web-API that returns the count of the 10 most frequent words together with their frequencies.
Within the api
folder, run dotnet restore
to install dependencies.
Within the api
folder, run dotnet run
to start the app.
Within the api
folder, run dotnet watch run
to start the app in dev mode.
Within the api.tests
folder, run dotnet test
to execute the unit tests.
Sending a POST request to /count of the application returns the count of the ten most frequent words in the input string.
"count": {
"href": "http://localhost:5116/count",
"method": "POST",
"desc": "Returns the count of the ten most frequent words in the input string",
"params": "{input_string}",
"header": "Content-Type: text/plain"
}
$ curl -H "Content-type: text/plain" -X "POST" -d "Banan Äpple Katt Hund Banan Hund Katt Hund" http://localhost:5116/count
$ {"Hund":3,"Banan":2,"Katt":2,"Äpple":1}