Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 637
mpjjonker Avatar asked Sep 12 '25 09:09

mpjjonker


1 Answers

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.

like image 127
user6062970 Avatar answered Sep 14 '25 01:09

user6062970