带有multipart / form-data和JSON的curl post [英] Curl post with multipart/form-data and JSON
本文介绍了带有multipart / form-data和JSON的curl post的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法使用curl做一个 multipart / form-data
post并指定数据 application / json
?
Is there a way to use curl to do a multipart/form-data
post and specify that the data is application/json
? It doesn't have to be curl.
推荐答案
这是我使用的,工作正常
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"
这篇关于带有multipart / form-data和JSON的curl post的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文