0

Hasta el momento todo va bien con GET o POST con un formulario HTML, pero se puede usar PUT, PATCH, UPDATE para usarlos como method al enviar el formulario?

1 respuesta 1

3

De acuerdo a esta otra respuesta en StackOverflow, esto no es posible ya que solo GET y POST son los métodos permitidos por la definición de la W3:

The method and formmethod content attributes are enumerated attributes with the following keywords and states:

  • The keyword get, mapping to the state GET, indicating the HTTP GET method.
  • The keyword post, mapping to the state POST, indicating the HTTP POST method.
  • The keyword dialog, mapping to the state dialog, indicating that submitting the form is intended to close the dialog box in which the form finds itself, if any, and otherwise not submit.

Se menciona un tercer, "dialog", pero no es comunmente usado. De acuerdo a los Usage Notes de Mozilla su funcionalidad si esta implementada:

form elements can be integrated within a dialog by specifying them with the attribute method="dialog". When such a form is submitted, the dialog is closed with a returnValue attribute set to the value of the submit button used.

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.