Basics of WEB and HTTP

Basics of WEB and HTTP

The concept of domain names

The ip address is not easy to remember. In the
early days, the Hosts file was used to resolve domain names. The
host name was duplicated. It was
difficult to maintain the host.
DNS (Domain Name System) was
distributed and
hierarchical.

Domain name space structure

Root domain,
top-level domain,
organization domain,
country/region domain name,
and second-level domain
FQDN=hostname.DNS suffix
Insert picture description here

domain registration

A method used in the Internet to solve the problem of address correspondence during domain name registration
Follow the principle of first application, first registration.
Domain name registration steps
Insert picture description here

Web concept

Web page
Plain text format file The
writing language is HTML
, which is translated into a web page in the user's browser. The
website is
composed of one page and is a combination of multiple web pages. The first web page that appears after the
home page is
opened is called the website. Homepage (or homepage)

Domain name
The URL entered when browsing a web page.
HTTP is
the communication protocol used to transmit web pages.
URL
is a World Wide Web addressing system.

HTML

Used to write pages of HTML
hyperlinks
Hyperlinks are the different web sites linked functional
release
will make a good web page uploaded to the server for user access process

HTML overview

HTML hypertext markup language
Hyper Text Markup Language
web page source code
Browser: "interpret and execute" HTMML source code tool
Insert picture description here

HTML document structure

HTML page
Header part
Title part
Main part
Web content, including text, images, etc.

<html>
<head>
<title>我的第一个网页</title>
</head>

<body >
	Hello World!
</body>

</html>

Basic webpage tags

The role of page summary information
is conducive to browser analysis and
is conducive to search engine search

标签 标签

Title tags
Row control related tags
Range tags
Image tags
Hyperlink tags
Special symbols

Web overview

Web (World Wide Web) is the global wide area network, also known as the World Wide Web.
A distributed graphic information system
, a network service built on the Internet.
Insert picture description here

Web1.0vsWeb2.0
Web1.0
is characterized by editing, where to go back to provide user content after editing, and then the user reads the content provided by the website.
This process is a one-way behavior from website to user.
Web2.0
pays more attention to User interaction, users are not only the consumers (browser) of the website content, but also the creators of the website content
. The interaction between the website and the user has been strengthened. The website content is based on the user's provision, and many functions of the website are also participated by the user. Construction, to realize the two-way communication and participation between the website and users.
Features of Web2.0
User sharing, community and development platform for Wie aggregation points, active users

Static pages

Static web standards HTML file
extension is .html, .htm
files, images, sound, Flash animation, client-side scripting and ActiveX controls and Java applets
is the foundation of the construction site, the early sites are generally static pages by making
no The acquired database, web pages without programs and non-interactive,
relatively troublesome to update, suitable for display-type websites with less updates in general lights

Every static webpage has a URL, and the URL is suffixed in common forms such as .html, .htm, .shtml, and does not contain "?". Once the
web page content is published on the website server, whether or not there is a user visit, the URL is Static web pages are stored on the website server.
The content of static web pages is relatively stable and easy to be retrieved by search engines.

Static pages without the support of the database, a larger workload in website design and maintenance, so when the site information is completely rely on static web pages making way more difficult when a lot
worse, there are greater restrictions in terms of functionality interactive static web
page The browsing speed is fast, no need to connect to the database during the process, the opening speed of the page is faster than the dynamic page

dynamic webpages

The URL of the webpage is not fixed, and it can interact with the user through the background
. There is a symbolic symbol in the URL of the dynamic webpage-"?"
Commonly used languages ​​include PHP, JSP, Python, Ruby, etc.
Insert picture description here

The characteristics of dynamic webpages
Interactivity The
webpage will dynamically change and respond according to the user's requirements and choices, using the browser as the client interface, which will be the general trend of the future development of the WEB.
Automatic letter
will be automatically generated without manually updating the HTML document The new page can greatly save the workload. It
varies from person to person at
different times. Different pages will be generated when different people visit the same website at different times.

Overview of
HTTP protocol HTTP protocol is the most widely used network protocol on the Internet.
The purpose of this protocol is to publish and receive HTML pages on the Web server.
HTTP protocol version
HTTP 0.9
HTTP 1.0
HTTP 1.1
HTTP 2.0
Insert picture description here

HTTP supports several different request commands. These commands are called HTTP methods.
Each HTTP request message contains a method to tell the server what action to perform.
Obtain a Web page.
Run a gateway program.
Delete a file.

The HTTP protocol has multiple methods to obtain Web resources.
Commonly used methods: GET and POST

HTTP method description
GET Request to obtain the resource identified by Request-URI
PUT Request the server to store a resource and use the Request-URI as its identifier
DELETE Request the server to delete the resource identified by Request-URI
POST Append new data after the resource identified by Request-URI
ROOST Request to obtain the response message header of the resource identified by Request-URI

GET method
GET method: Get data from the specified server.
GET requests can be cached.
GET requests will be saved in the browser’s browsing records.
GET requests have length limitations . The string
used to obtain data
queries will be displayed in the URI. Safety

POST method
POST method: Provide data to the designated server for processing
POST requests. POST requests cannot be cached.
POST requests will not be stored in the browser’s browsing history.
POST requests have length restrictions. The
query string will not be displayed in the URI, which is more secure

HTTP status code
When a browser visits a URL at that time, it will return the corresponding processing status according to the processing situation.
Usually the normal status code is 2xx, 3xx
will return 4xx, 5xx if there is an exception

First digit of status code Defined range classification
1xx 100-101 message notification
2xx 200-206 success
3xx 300-305 Redirect
4xx 400-415 Client error
5xx 500-505 Server Error

Common HTTP status codes in production environments

news description
200 OK The request is successful (afterwards for GET and POST requests) response file
301 Moved Permanently Requested permanent page jump
403 Forbidden Prohibit access to modified pages
404 Not Found The server cannot find the requested page
500 Internet Server Error internal server error
502 Bad Gateway Invalid gateway
503 Service Unavailable Current service is unavailable
504 Gateway Timeout Gateway request timed out

Analysis of HTTP protocol request process
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_46355881/article/details/107772455
Recommended