2.1host
After Tim Berners-Lee invented the World Wide Web, HTML, HTTP and web servers, he decided to make life harder for future web programmers and came up with links, or URLs. URL stands for Universal Resource Locator.
A typical link is given by a template:
protocol://host/path?query#anchor
Some of the parts may be missing, but protocol
should host
always be listed.
Protocol
specifies the name of the protocol by which the client and server will communicate. Typical protocol names: HTTP, HTTPS, FTP, SSH, ...
Host
is the name of the server on the network to send the request to. Initially it was an IP address, but people quickly came up with human-readable names (domain names) so as not to remember anything. As if remembering a couple of numbers is so difficult)
Initially, none query
was thought of. Path
specified the location of the HTML file that the server was supposed to give to the client. However, after the web was taken over by amateurs, they quickly realized that HTML files could be dynamically created on the server side. Therefore, a section was added to the URL query
, in which a bunch of useful information can be passed to the server.
And finally anchor
, this is just a special label on an HTML page that tells the browser that the page should not only be displayed, but also scrolled to a certain place, that is, a label.
2.2 query & params
I'll tell you a little more about query
.
The part of the link under the titlequery
starts immediately after the question mark and ends with a # (or the end of the link). The information in the query is a set of parameters in the following form:
name=value&name2=value2&nameN=valueN
The URL cannot contain spaces and a bunch of other characters, so all suspicious characters are escaped. Most likely, you often encountered this when you copied a link and threw it to a friend:
width="300" | Symbol | Encoding |
---|---|---|
1 | space | %20 |
2 | ! | %21 |
3 | # | %22 |
4 | $ | %24 |
5 | % | %25 |
6 | & | %26 |
7 | ' | %27 |
8 | * | %2A |
9 | + | %2B |
10 | , | %2C |
eleven | / | %2F |
You can read more on this topic at the link .
GO TO FULL VERSION