Json 在bash脚本中通过curl提交到sharepoint

Json 在bash脚本中通过curl提交到sharepoint,json,bash,curl,sharepoint,Json,Bash,Curl,Sharepoint,这件事让我挠头好几天了。不幸的是,Google foo没有出现太多。如果可能的话,为了便于携带,我想留在bash 这项工作: node="$(curl -s --anyauth -u dom\\r-hah:haha -d '{"Filename":"0117-SCLP1-6230-0_E_H.mp4", "MediaPath":"\/2016", "SpotNumber":"0117-SCLP1-6230-0 E H", "SpotName":"TEST FOR TECH", "Des

这件事让我挠头好几天了。不幸的是,Google foo没有出现太多。如果可能的话,为了便于携带,我想留在bash

这项工作:

    node="$(curl -s --anyauth -u dom\\r-hah:haha -d '{"Filename":"0117-SCLP1-6230-0_E_H.mp4",
"MediaPath":"\/2016",
"SpotNumber":"0117-SCLP1-6230-0 E  H",
"SpotName":"TEST FOR TECH",
"Description":"TEST SPOT ONLY",
"ShipListPromoID":"467733"}' -H content-type:application/json -X POST https://somewebsite.com/fcp/_vti_bin/ListData.svc/FinishedSpots);
 echo "${node}"
这并不是:

dslresults="$(php /usr/local/sbin/lookupupfrontspot.php "0117-SCLP1-6230-0_E_H.mp4")";
 echo "${dslresults}";
 node="$(curl -s --anyauth -u dom\\r-hah:haha -d '$dslresults' -H content-type:application/json -X POST https://somewebsite.com/_vti_bin/ListData.svc/FinishedSpots);
 echo "${node}"
让我补充一下,在第一个示例中,我正在复制和粘贴第二个示例中echo“${dslresults}”的结果。所以我猜这是某种格式错误,但我似乎无法识别它

我有什么明显的麻烦吗?(我肯定有很多) 多谢。 -N

Got-it:node=“$(echo$dslresults|curl-s--anyauth-u dom\\r-hah:haha-d@--H内容类型:application/json-X POST)”;echo“${node}”得到它:node=“$(echo$dslresults|curl-s--anyauth-u dom\\r-hah:haha-d@--H内容类型:application/json-X POST)”;回显“${node}”