且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

带有multipart / form-data和JSON的curl post

更新时间:2022-01-18 07:57:31

这是我使用的,工作正常

This is what I use, and it works fine

curl -v -H "Content-Type:multipart/form-data" 
        -F "someName={\"your\":\"json\"};type=application/json"

m在Windows上,因此需要双引号

Note: I'm on Windows, hence the requirement for double quotes

-F "someName=@someJsonFile.json;type=application/json"