Why don't the modern browsers support PUT and DELETE form methods?

前端 未结 3 1986
伪装坚强ぢ
伪装坚强ぢ 2021-01-01 09:08

I just finished building a RESTful API for one of my latest apps. I also built a simple admin interface scaffolding class that will enumerate resources and build simple form

相关标签:
3条回答
  • 2021-01-01 09:39

    Some web frameworks (e.g. Ruby on Rails) get around that by including a hidden _method parameter in the form with the value of the "actual" method, e.g.:

    <form action="/posts/xxxxx" method="POST">
        <input type="hidden" name="_method" value="DELETE">
        <input type="submit" value="delete">
    </form>
    

    The framework then rewrites the request on the server side before processing to use the value of the _method parameter as the HTTP method.

    Don't know if this helps you.

    0 讨论(0)
  • 2021-01-01 09:46

    Actually i did a very small amount of research & found this answer on other Stackexchange forum.

    I know it's not a good answer to post a link but i don't know the exact answer. So, it's the only way you can solve your doubt.

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

    0 讨论(0)
  • 2021-01-01 09:53

    HTML 4.01 supports only post and get, see http://www.w3.org/TR/html4/interact/forms.html#h-17.3 Not sure about other HTML specs.

    0 讨论(0)
提交回复
热议问题