Curl无法打开表单字段中带括号[]的文件
我使用的api(phaxio)指定: 将方括号放在参数名称后以发送多个文件(例如文件名[]) 然而,当我在表单字段后加上square时,我得到了一个无法打开文件的错误Curl无法打开表单字段中带括号[]的文件,curl,Curl,我使用的api(phaxio)指定: 将方括号放在参数名称后以发送多个文件(例如文件名[]) 然而,当我在表单字段后加上square时,我得到了一个无法打开文件的错误 touch /foo curl http://example.org -F "filename[]=@/foo" // curl: (26) couldn't open file "/foo" curl http://example.org -F "filename=@/foo" // works 我可以通过这样做来
touch /foo
curl http://example.org -F "filename[]=@/foo" // curl: (26) couldn't open file "/foo"
curl http://example.org -F "filename=@/foo" // works
我可以通过这样做来解决它
touch /foo
touch /bar
curl http://example.org -F "filename[0]=@/foo"
curl http://example.org -F "filename[1]=@/bar"
请注意,在我的示例中,我演示了发送多个文件,据我所知,这是您的意图。我在windows上使用它,windows上的curl实现肯定有问题 在linux上工作很好——我只是没想到在那里尝试