我遇到了一个问题,我正试图通过curl使用终端向服务器发送JSON有效负载
curl -v -u admin:admin123 --header" Content-Type:application / json" ' http://localhost:8080/service/siesta/rest/v1/script/' -d' {" name":" trg_dao"," type":" groovy"," content&#34 ;:" blobStore.createFileBlobStore(' trg_dao',' / tmp / trg_dao')"}'它会上传为
{ "名称" :" trg_dao", "内容" :" blobStore.createFileBlobStore(trg_dao,/ tmp / trg_dao)", "类型" :" groovy" }
使用-d @filename(curl -v -g -u admin:admin123 --header" Content-Type:application / json"' http://localhost:8080/service/siesta/rest/v1/script/' --data-binary @ test.json)
{ "名称" :" trg_dao", "内容" :" blobStore.createFileBlobStore(' trg_dao',' / tmp / trg_dao')", "类型" :" groovy" }
我正在使用的有效负载是
{" name":" trg_dao"," type":" groovy"," content":& #34; blobStore.createFileBlobStore(' trg_dao'' / TMP / trg_dao')"}
关于我哪里出错的任何指示将非常有帮助。
最诚挚的问候 希瓦
答案 0 :(得分:0)
我已解决了以下问题
curl -v -u admin:admin123 -H“Content-type:application / json”-d'{“name”:“trg_dao”,“type”:“groovy”,“content”:“blobStore.creaileBlobStore ('“''trg_dao'”','''/ tmp / trg_dao'“')”}''http://localhost:8080/v1/script/'