openwhiskibm-cloud-functions

IBM Cloud Functions WebAction gives empty response (204)


I am running into strange behavior with IBM Cloud Functions. I have an Action that is web enabled (WebAction) for which I don't require authentication. I use Postman (and a browser) to test this new REST endpoint.(left side of the image below) The result is empty, an actual 204 No Content reponse.

But when I monitor the Action, I can see that it has been invoked and returned the expected JSON (right side of the image below). So the code is executed correctly.

enter image description here

When I perform a commandline invoke:

bx wsk action invoke --result talkToEoffice --param name FunctionWorld

I do see the expected result. Should I provide additional headers ?

Does this have something todo with synchronous (blocking) or non-blocking ?


Solution

  • Looks like you’re returning an object with a property called greeting. For a webaction the response must include a property called body instead. You can nest greeting under body. See https://github.com/apache/incubator-openwhisk/blob/master/docs/webactions.md#handling-http-requests-with-actions for response requirements.