dubeejw commented on a change in pull request #2609: Support json response in
HTTP web actions without base64 encoding.
URL:
https://github.com/apache/incubator-openwhisk/pull/2609#discussion_r133008319
##########
File path: docs/webactions.md
##########
@@ -102,11 +102,13 @@ function main(params) {
return {
statusCode: 200,
headers: { 'Content-Type': 'application/json' },
- body: new Buffer(JSON.stringify(params)).toString('base64'),
+ body: params
};
}
```
+The default content-type for an HTTP response is `application/json` and the
body may be any allowed JSON value. The default content-type may be omitted
from the headers.
Review comment:
There is a section in the doc entitled `Decoding binary body content from
Base64`. Do we want to deprecate the Base64 functionality so that we can remove
it at some point? @csantanapr, FYI.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services