Provide ability to pass parameters as a JSON object on the command line
- Dominant language
- Go
- Stars
- 109
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Description
@l2fprod commented on [Wed Nov 16 2016](https://github.com/apache/incubator-openwhisk/issues/1513)
Just like I can pass the JSON body of a request on the command line with cURL, I'd like to be able to pass the parameters the same way with the OpenWhisk CLI
```
curl -H "Content-Type: application/json" -X POST -d '{"username":"xyz","password":"xyz"}' http://localhost:3000/api/login
```
as example:
```
wsk action invoke --body '{"key1": "value1", "object1": { "object1Prop": "anotherValue" }}'
```
---
@mbehrendt commented on [Wed Nov 16 2016](https://github.com/apache/incubator-openwhisk/issues/1513#issuecomment-260885474)
good point.
should we even allow piping it in, sth like `echo | wsk action invoke myAction` ?
---
@dubeejw commented on [Wed Nov 16 2016](https://github.com/apache/incubator-openwhisk/issues/1513#issuecomment-260973313)
You can put the JSON in a file, and pass that filename to the -P flag.
---
@l2fprod commented on [Wed Nov 16 2016](https://github.com/apache/incubator-openwhisk/issues/1513#issuecomment-260973908)
true but here I don't want to have to create a temp file.
Contributor guide
Assessment
This issue has not been assessed yet.