From 9f74b6ab2b2a3be9821fc015bceb69c5fe8d702a Mon Sep 17 00:00:00 2001 From: Fabian Eichhorner Date: Thu, 13 Dec 2018 10:08:20 +0100 Subject: [PATCH] fixed curl commands --- service-reporting/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/service-reporting/README.md b/service-reporting/README.md index 527651f..715d1a3 100644 --- a/service-reporting/README.md +++ b/service-reporting/README.md @@ -44,7 +44,7 @@ Term(string `Name`, double `Sentiment`) - `dotnet run` ## Tests -- successfull pdf as application/json: `curl -X POST \ http://localhost:8083/generatePDF \ -H 'Content-Type: application/json' \ -d '[ { "name": "A bad term", "sentiment": 0.1 }, { "name": "Another bad term", "sentiment": 0.3 }, { "name": "A neutral term", "sentiment": 0.5 }, { "name": "A good term", "sentiment": 0.65 }, { "name": "Another good term", "sentiment": 0.9 } ] '` -- successfull pdf as application/base64: `curl -X POST \ http://localhost:8083/generatePDF \ -H 'Accept: application/base64' \ -H 'Content-Type: application/json' \ -d '[ { "name": "A bad term", "sentiment": 0.1 }, { "name": "Another bad term", "sentiment": 0.3 }, { "name": "A neutral term", "sentiment": 0.5 }, { "name": "A good term", "sentiment": 0.65 }, { "name": "Another good term", "sentiment": 0.9 } ] '` -- invalid sentiment value: `curl -X POST \ http://localhost:8083/generatePDF \ -H 'Content-Type: application/json' \ -d '[ { "name": "Term with invalid sentiment value", "sentiment": 12 } ] '` -- invalid json structure: `curl -X POST \ http://localhost:8083/generatePDF \ -H 'Content-Type: application/json' \ -d '[ { "name1": "A term with invalid json format", "sentiment": 0.5 } ] '` \ No newline at end of file +- successfull pdf as application/json: `curl -X POST http://localhost:8083/generatePDF -H 'Content-Type: application/json' -d '[ { "name": "A bad term", "sentiment": 0.1 }, { "name": "Another bad term", "sentiment": 0.3 }, { "name": "A neutral term", "sentiment": 0.5 }, { "name": "A good term", "sentiment": 0.65 }, { "name": "Another good term", "sentiment": 0.9 } ] ' > test1.pdf` +- successfull pdf as application/base64: `curl -X POST http://localhost:8083/generatePDF -H 'Accept: application/base64' -H 'Content-Type: application/json' -d '[ { "name": "A bad term", "sentiment": 0.1 }, { "name": "Another bad term", "sentiment": 0.3 }, { "name": "A neutral term", "sentiment": 0.5 }, { "name": "A good term", "sentiment": 0.65 }, { "name": "Another good term", "sentiment": 0.9 } ] ' | base64 -d > test2.pdf` +- invalid sentiment value: `curl -X POST http://localhost:8083/generatePDF -H 'Content-Type: application/json' -d '[ { "name": "Term with invalid sentiment value", "sentiment": 12 } ] '` +- invalid json structure: `curl -X POST http://localhost:8083/generatePDF -H 'Content-Type: application/json' -d '[ { "name1": "A term with invalid json format", "sentiment": 0.5 } ] '` \ No newline at end of file -- 2.43.0