multipart/form-data vs application/octet-stream

时光怂恿深爱的人放手 提交于 2019-12-03 22:03:11
Stefan Kögl

While you don't intend to send any other data together with the file right now, multipart/form-data would give you the possibility to add additional data later on if this is required (without breaking compatability).

Also multipart/form-data would make it possible to access the REST API directly by submitting an HTML form (see https://stackoverflow.com/a/4526286/693140).

Your API could however support both types by using the client's content type header to distinguish between them.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!