Java Network-basic web concepts, java-web
First, we need to understand three key concepts in the web.
1. HTTP, HTML, URL.
The full name of HTML is Hypertext Markup Language, which is used to describe a Web page. Or, the language is used to describe the "appearance" of a webpage ".
The browser determines what it looks like.
That is to say, HTML is OK. For example, "This is a title" and "must be emphasized here.
HTML text is a descriptive text composed of HTML commands. HTML commands can describe text, graphics, animations, sounds, tables, links, and so on. The structure of HTML consists of the header and Body. The header describes the information required by the browser, and the Body contains the specific content to be described.
HTTP: Hypertext Transfer Protocol. It is a protocol that the WWW server transmits to a local browser. The transmitted content is the text described in HTML.
HTTP is designed to send and accept HTML.
URL: Uniform/Universal Resource Locator is also called a webpage address. That is, to tell the local browser how to find a resource address from the WWW server.
Therefore, you can use the URL to locate the resource, download the HTML text to the local browser through the HTTP protocol, and then display the HTML text in the browser.
Ii. URI
URI, URL, URN.
URI and URL are often seen, especially in android.
URI is an uniform resource identifier. It is a unified resource identifier that uniquely identifies a resource.
The URL is the uniform resource locator, which is a uniform resource locator. It is a specific URI, that is, the URL can be used to identify a resource and specify how to locate the resource.
URI can be understood as a lower-level URL.
URL is the abbreviation of Uniform Resoure Locator. The address of the WWW page.
The URL format is scheme: // host: Port/path.
In Java Uris, a URI instance can represent absolute or relative, as long as it complies with the URI syntax rules. The URL class not only conforms to the semantics, but also contains information for locating the resource. Therefore, it cannot be relative and the schema must be specified.
URL & URN is two different forms of URI.
Iii. HTML & XML
XML is one of the most common network transmission languages, JSON and xml.
It does not have syntax rules such as <H1>, <p>, but it has verification requirements. The order cannot be reversed.
XML is a supplement instead of HTML.
HTML is used to transmit browser text.
XML transmission of network content, such as obtaining a student list from the server.
Iv. MIME media type
MIME is a widely accepted multimedia expression, especially in linux.
Therefore, this standard is also used in android to differentiate file types.
MIME currently supports more than 100 predefined content types.
The content type is divided into two levels: type and subtype. Such as image/gif and video/mpeg.
In addition to the standard type, you can also define some non-standard type control for self-use. For example
Application/x-tif
Of course, many of these non-standard types are also called a default form because many mime types are widely used.