我是个新手,我试图在Windows 10中运行Linux命令来生成会话密钥。下面是Linux中的命令。
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys"}' http://localhost:9933/ 当我在Windows命令提示符下运行该命令时,我将收到以下错误。
E:\>curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys"}' http://localhost:9933/
curl: (3) URL using bad/illegal format or missing URL
curl: (3) URL using bad/illegal format or missing URL
curl: (3) unmatched close brace/bracket in URL position 18:
author_rotateKeys}'
^
E:\>您知道我如何隐藏命令以使用Windows 10吗?我只需要为我需要从Windows框连接到的节点生成一个键。
发布于 2022-03-18 11:15:28
如果您没有WSL2设置(如果您需要其他*nix工具的话),那么该命令将按原样工作,或者不想在其中使用PowerShell
curl.exe -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys"}' http://localhost:9933/工作(请注意,curl是用curl.exe替换的,因为在PowerShell 5.1中,curl只是Invoke-WebRequest的别名,它在PowerShell 6和更高版本中被删除,但它们不是内置的,安装后不会替换PowerShell 5.1 ),然后在命令提示符上用双引号替换单引号,对于其中的双引号,转义它(用\“替换它)
curl -H "Content-Type: application/json" -d "{\"id\":1, \"jsonrpc\":\"2.0\", \"method\": \"author_rotateKeys\"}" http://localhost:9933/https://stackoverflow.com/questions/71526043
复制相似问题