To test out the install, you will need a way to make an HTTP
request. Common methods are:
-
From the command line using curl
-
From Windows Powershell using Invoke-WebRequest
-
From a browser using the interactive documentation
Ping the server to test that Rosette is running and you can connect to it.
-
bash:
curl http://localhost:8181/rest/v1/ping
-
Windows Powershell:
Invoke-WebRequest -Uri http://localhost:8181/rest/v1/ping
-
Windows Command Prompt:
start "" http://localhost:8181/rest/v1/ping
This should return:
{"message":"Rosette at your service","time":1467912784915}
This should return:
{"name":"Rosette","version":"<current-version>","buildNumber":"","buildTime":""}
Test an endpoint that you have a license for. For example, the following code tests the entities
endpoint.
-
bash:
curl --request POST \
--url http://localhost:8181/rest/v1/entities \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"content": "Bill Murray will appear in new Ghostbusters film: Dr. Venkman was spotted filming in Boston."}'
-
Windows Powershell:
Invoke-WebRequest -Uri http://localhost:8181/rest/v1/entities
-Method POST
-Headers @{"accept"="application/json"}
-ContentType "application/json"
-Body '{"content":"Bill Murray will appear in new Ghostbusters film: Dr. Venkman was spotted filming in Boston."}'
This will return a list of extracted entities in JSON format.
Note
Calling an endpoint that you are not licensed for will result in an error.