我已經嘗試了幾天來弄清楚如何轉換在 Linux 終端中完美運行的 cURL 命令,但無法弄清楚如何正確格式化它以便我可以在 Windows bat 檔案中使用它。任何幫助將不勝感激。
在 Linux 中完美運行的 Linux cURL 命令:
curl -X PUT \
-H 'Accept:application/json; charset=utf-8' \
-H 'Content-type:application/json; charset=utf-8' \
http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/testlive/pushpublish/mapentries/ppsource \
-d'
{
"serverName": "_defaultServer_",
"sourceStreamName": "newStream",
"entryName": "ppsource",
"profile": "rtmp",
"host": "localhost",
"application": "testlive",
"userName": "testUser",
"password": "pass",
"streamName": "myStream"
}'
如何在 Windows cmd 中執行相同操作?
uj5u.com熱心網友回復:
- 將單引號改為雙引號
- 將換行符從
\改為^ - 檢查有效命令
echo on
或者使用瀏覽器(使用windows),打開開發者模式(F12)并復制一個網路條目 copy as windows curl
uj5u.com熱心網友回復:
使用 carret^作為換行符而不是反斜杠\,并雙引號所有字串而不是單引號,包括末尾的 json。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/396801.html
