Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
cURL在Windows上发送POST请求中包含JSON的表单时,将逗号作为分隔符_Json_Windows_Curl_Command Line_Cmd - Fatal编程技术网

cURL在Windows上发送POST请求中包含JSON的表单时,将逗号作为分隔符

cURL在Windows上发送POST请求中包含JSON的表单时,将逗号作为分隔符,json,windows,curl,command-line,cmd,Json,Windows,Curl,Command Line,Cmd,我使用cURL上传文件盒,使用以下指南: 有很多针对unix的cURL指南和文章,但我找不到任何针对Windows的指南和文章,也找不到如何做到这一点。我正在使用Windows命令行,我的命令如下: curl -X POST --header "Authorization: Bearer ACCESS_TOKEN" --header "Content-type: application/json" "https://upload.box.com/api/2.0/files/content" -

我使用cURL上传文件盒,使用以下指南:

有很多针对unix的cURL指南和文章,但我找不到任何针对Windows的指南和文章,也找不到如何做到这一点。我正在使用Windows命令行,我的命令如下:

curl -X POST --header "Authorization: Bearer  ACCESS_TOKEN" --header "Content-type: application/json" "https://upload.box.com/api/2.0/files/content" -F file=@test.txt -F attributes="{\"name\":\"test.txt\",\"parent\":{\"id\":\"0\"}}"
我得到以下回应:

警告:字段规范结尾的垃圾:,“父项”:{“id”:“0”}


这个问题是因为cURL将逗号作为文件分隔符,所以它会在逗号出现的地方结束对JSON的处理。我尝试了很多组合,但我不能处理这个。我想这可能是一个转义字符的技巧,或者是其他什么…

逗号的问题已经在最新版本的cURL中得到了解决- (11月29日),所以我的问题解决了,现在一切正常:)