卷曲更改 multipart/form-data 路径参数

Curl changes multipart/form-data path parameter

我尝试在 msys shell 中使用 curl 将一些 multipart/form-data 数据发送到名为 Synology 的 NAS。表单数据需要一个名为 "path" 的参数,并且格式必须类似于“/dir/dir2”。不能更改斜线。
我的问题是,当我使用 curl 时,路径变量将更改为 "C:/git-sdk-64/dir/dir2" 并且我不知道如何防止它。我的命令如下所示:

curl -X POST \
  'http://url:port/webapi/entry.cgi?_sid=secret&api=SYNO.FileStation.Upload&method=upload&version=2' \
  -F "path=/dir/dir2" \
  -F 'overwrite=true' \
  -F 'filename=@/c/Temp/test.txt'

感谢Daniel Stenberg's info i found out this is a "problem" with msys self. Msys fills up the path variable. Written down here http://www.mingw.org/wiki/Posix_path_conversion。解决方案是在路径的末尾放置一个分号。完整的命令现在看起来像这样:

curl -X POST \
  'http://url:port/webapi/entry.cgi?_sid=secret&api=SYNO.FileStation.Upload&method=upload&version=2' \
  -F "path=/dir/dir2;" \
  -F 'overwrite=true' \
  -F 'filename=@/c/Temp/test.txt'