Depending on the value you set in buildtemplate.yaml for the OW_RUNTIME_PLATFORM
parameter, you will need to invoke different endpoints to execute the test.
curl -H "Host: nodejs-helloworld-with-params.default.example.com" -d '{"value": {"name": "Joe", "place": "TX"}}' -H "Content-Type: application/json" http://localhost/
You have an option to initialize the runtime with the function and other configuration data if its not initialized (i.e. built using build-without-code.yaml.tmpl)
curl -H "Host: nodejs-helloworld-with-params.default.example.com" -d "@knative-data-init.json" -H "Content-Type: application/json" http://localhost/ {"OK":true}
Execute the function.
curl -H "Host: nodejs-helloworld-with-params.default.example.com" -d "@knative-data-run.json" -H "Content-Type: application/json" -X POST http://localhost/ {"payload":"Hello Jill from OK!"};
Initialize the runtime with the function and other configuration data using the /init
endpoint.
curl -H "Host: nodejs-helloworld-with-params.default.example.com" -d "@openwhisk-data-init.json" -H "Content-Type: application/json" http://localhost/init {"OK":true}
Execute the function using the /run
endpoint.
curl -H "Host: nodejs-helloworld-with-params.default.example.com" -d "@openwhisk-data-run.json" -H "Content-Type: application/json" -X POST http://localhost/run {"payload":"Hello Joe from TX!"};