Send Data Across the Network with the <form> Element

Semantic HTML Basics

Alex Z
Webtips
Published in
4 min readSep 25, 2022

--

The HTML Form is a very important element to your job as a web developer. It is the most fundamental method of sending data from a web page to a server.

Photo by Alex Padurariu on Unsplash

A very simple form might look like this:

When the form element is submitted, it sends information to the internet location listed in the ‘action’ attribute.

What type of data does the <form> send?

The form can send data in two different formats, depending on the type of data. Generally speaking, you won’t need to interact directly with either of these datatypes on the receiving server, but instead you will use an extension like express-urlencoded or express-fileupload to parse the streamed data and process it. Regardless, the content types that are sent by the form element are:

Simple Data (no files or images)

The form element sends an http/https request with a body that contains x-www-form-urlencoded data. The…

--

--

Alex Z
Webtips

Software Developer + Product Manager. Interested in Travel, Culture, Economics and the Internet. Join Medium: https://tinycode.medium.com/membership