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

  1. Open a terminal in JupyterLab by clicking FileNewTerminal.
  2. 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>/prediction

    For example:

    curl -X POST -H "Content-Type: application/json" --data {"data" : "hello world"} http://myapp-myproject.apps.mycluster.abc1.s1.devshift.org/prediction

    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>/prediction

Verification

  • The endpoint is working if you receive a response from the application, such as {"prediction" : "not implemented"}.