akrabat commented on issue #2630: JSON encoding is inconsistent for web actions URL: https://github.com/apache/incubator-openwhisk/issues/2630#issuecomment-323099171 Bluemix results for comparison (only base64 encode tests): ```php <?php function main(array $args) : array { return [ "body" => base64_encode(json_encode(["greeting" => "Hello world"])), "headers" => ["Content-Type" => "application/json-patch+json"], ]; } ``` gives: ``` $ curl -i https://openwhisk.eu-gb.bluemix.net/api/v1/web/19FT_dev/default/hello HTTP/1.1 200 OK Content-Type: application/json-patch+json {"greeting":"Hello world"} ``` So this works on Bluemix, but not locally. ```php <?php function main(array $args) : array { return [ "body" => base64_encode(json_encode(["greeting" => "Hello world"])), "headers" => ["Content-Type" => "application/problem+json"], ]; } ``` gives: ``` $ curl -i https://openwhisk.eu-gb.bluemix.net/api/v1/web/19FT_dev/default/hello HTTP/1.1 400 Bad Request Content-Type: application/json; charset=UTF-8 { "error": "Response did not specify a known content-type.", "code": 2710626 } ``` Fails on both. ---------------------------------------------------------------- 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
