Do浏览器支持多部分/表单数据的PUT请求 [英] Do Browsers support PUT requests with multipart/form data

查看:127
本文介绍了Do浏览器支持多部分/表单数据的PUT请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从Google Chrome提交此表单时,浏览器会发出GET请求。

When I submit this form from Google Chrome, the browser makes a GET request. Are HTTP PUT requests with multipart/form-data encoding submitted from HTML forms generally unsupported client-side?

<form id="#main-form" action="http://localhost:8080/resource/1" method="put"
            enctype="multipart/form-data">
    <input type="text" name="name"/>
    <input type="submit" value="submit" />
</form>     


推荐答案

HTML标记语言仅支持GET和POST请求,但您可以使用Ajax创建其他请求(PUT,DELETE等)。

The HTML markup language only support GET and POST requests, but you can make the other requests (PUT,DELETE,etc) with Ajax.

已经有关于此问题的回答问题:
https://softwareengineering.stackexchange.com/questions/114156/ why-there-no-put-and-delete-methods-in-html-forms

There are already answered questions about this: https://softwareengineering.stackexchange.com/questions/114156/why-there-are-no-put-and-delete-methods-in-html-forms

为什么浏览器不支持PUT和DELETE请求,以及它们何时?

这篇关于Do浏览器支持多部分/表单数据的PUT请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆