【发布时间】:2015-11-28 16:24:30
【问题描述】:
我正在编写一个 simple shell 脚本,当使用 curl 满足条件时,我将使用它在 JIRA 中创建一个请求。以下是 JIRA 的执行方式,需要我使用数据文件将发送请求作为命令和参数发送:
请求:
curl -D- -u fred:fred -X POST --data {see below} -H "Content-Type: application/json" http://localhost:8090/rest/api/2/issue/
数据:
{
"fields": {
"project":
{
"key": "TEST"
},
"summary": "REST ye merry gentlemen.",
"description": "Creating of an issue using project keys and issue type names using the REST API",
"issuetype": {
"name": "Bug"
}}}
所以我不想使用如上所示的单独数据文件。相反,我想使用单个 curl 请求,该请求中嵌入了数据。比如:
curl -D- -u fred:fred -X POST --"**PASS ALL MY DATA HERE**" -H "Content-Type: application/json" http://localhost:8090/rest/api/2/issue/
我知道这会使事情变得混乱,但这就是我想要的方式。能否请您建议上述是否可行。
【问题讨论】: