code-301-reading-notes

View project on GitHub

Forms Submission

  • A client (usually a web browser) sends a request to a server using the HTTP protocol.
  • The server answers the request using the same protocol.
  • The <form> element defines how the data will be sent.
  • The two most important attributes are action and method.
  • The action attribute defines where the data gets sent.
  • Its value must be a valid relative or absolute URL.
  • It’s possible to specify a URL that uses the HTTPS (secure HTTP) protocol.
  • The method attribute defines how data is sent.
  • The HTTP protocol provides several ways to perform a request.
  • HTML form data can be transmitted via a number of different methods.
  • The most common being the GET method and the POST method.
  • The GET method is the method used by the browser to ask the server to send back a given resource.
  • The browser sends an empty body.
  • The POST method is the browser uses to talk to the server when asking for a response that takes into account the data provided in the body of the HTTP request.