且构网

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

使用 jQuery 使用 multipart/form-data 进行 HTTP POST 调用?

更新时间:2022-01-25 08:41:16

multipart/form-data 看起来不是这样的:

dcs.source=boss-web&query=data&dcs.algorithm=lingo&dcs.output.format=JSON&dcs.clusters.only=true

这是application/x-www-form-urlencoded.

这是一个示例,说明如何multipart/form-data 请求看起来像.以及相关的 RFC 1867.

Here's an example of how multipart/form-data request looks like. And the related RFC 1867.

multipart/form-data 通常与上传文件有关.如果这是您的情况,您可以查看 jquery 表单插件,它允许您将表单和也支持文件上传.

multipart/form-data is quite often associated with uploading files. If this is your case you could take a look at the jquery form plugin which allows you to ajaxify forms and supports file uploads as well.