如何通过Spring云数据流上的REST调用定义新流?

时间:2016-10-26 14:27:34

标签: spring rest spring-cloud-dataflow

我想使用REST API在Spring云数据流上定义和部署新流。但是在documentations上,没有关于如何构建我的“POST”调用的参考。

当我向http://localhost:9393/streams/definitions发送POST电话时 用:

 {   "name": "chp",
    "dslText": "time | log", }

我得到答案:

  {
    "logref": "MissingServletRequestParameterException",
    "message": "Required String parameter 'name' is not present",
    "links": []
  }

任何人都知道使用REST API的格式是什么?

非常感谢你!

1 个答案:

答案 0 :(得分:1)

最简单的方法是使用正确的编码确保相关属性包含在URL参数中。

例如,ticktock流创建将是:

  

curl -X POST http://localhost:9393/streams/definitions \?definition \ = time +%7C + log \& name \ = foo

例如,ticktock流部署将是:

  

curl -X POST http://localhost:9393/streams/deployments/foo