HTML form serialization

An HTML form submission is exposed to a server as an HTTP GET or POST request.

When a form is submitted, the browser collects the form data and serializes it:

Serialization is the process whereby a data structure is translated into a format suitable for transfer over a network.

For GET requests

Data:

  • is URL-encoded
  • and added in the URL's query string as query param(eter)s

Notes:

For POST requests

Data:

  • is serialized into the structure specified by the enctype attribute
  • and added in the HTTP request body

enctype can be:

  • application/x-www-form-urlencoded
  • multipart/form-data
  • text/plain

Query params

Any HTTP method type may include query params.

When a form is submitted using the POST method to an URL containing query params:

  • the query params are sent to the server
  • they are separated from the request body
  • they should be treated as read-only

Avant Enum in Django Après Hypermedia Systems

A Kemar Joint