Chapter 11. Testing the deployed application endpoint for your prediction function
After you deploy your application, you can test that your prediction function works properly at the deployed endpoint.
Prerequisites
- Your application is built and deployed with your prediction function included.
- You know the web address for the application containing your prediction function.
Procedure
- Open a terminal in JupyterLab by clicking File → New → Terminal.
Run the following command, replacing
<application-url>
with the web address for the application, for example,http://myapp-myproject.apps.mycluster.abc1.s1.devshift.org
.curl -X POST -H "Content-Type: application/json" --data '{"data" : "hello world"}' <application-url>/predictions
For example:
curl -X POST -H "Content-Type: application/json" --data '{"data" : "hello world"}' http://myapp-myproject.apps.mycluster.abc1.s1.devshift.org/predictions
Alternatively, enter
!
followed by the same command in a new notebook cell and run the cell.!curl -X POST -H "Content-Type: application/json" --data '{"data" : "hello world"}' <application-url>/predictions
Verification
-
The endpoint is working if you receive a response from the application, such as
{"predictions" : "not implemented"}
.