如何通过命令行界面运行这个curl命令?

问题描述 投票:0回答:1

我正在尝试通过api接口将我的作品上传到deviantart

他们给出以下行作为示例

 curl https://www.deviantart.com/api/v1/oauth2/stash/submit \
-F "title=My great stash item&artist_comments=This is a great image&keywords=test image" \
-F access_token=Alph4num3r1ct0k3nv4lu3 \
-F "test=@path/to/image.png"

我用自己的参数改了参数,安装了windowscurl

但是我不知道如何使用curl执行这个多行命令

感谢您的帮助

curl command-line cmd
1个回答
3
投票

您可以将所有内容放在一行中,或者将行末尾的

\
字符替换为
^
(批处理文件的延续字符)

不确定你的参数,但你应该记住

cmd
有行长度限制:XP为2048,Vista及更高版本的操作系统为8192

另一个问题可能是角色。

批处理文件中的

%
字符需要转义,将其替换为
%%

&),=
字符必须位于用引号引起来的字符串中或转义为
^&
, ...

© www.soinside.com 2019 - 2024. All rights reserved.