refactor
This commit is contained in:
parent
a6c7bc1a27
commit
ebf9058dec
1 changed files with 15 additions and 17 deletions
|
@ -2,6 +2,7 @@
|
|||
obj: concept
|
||||
source: https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL
|
||||
---
|
||||
|
||||
# URL
|
||||
The target of an [HTTP](HTTP.md) request is called a "resource", whose nature isn't defined further; it can be a document, a photo, or anything else. Each resource is identified by a Uniform Resource Identifier ([URI](https://developer.mozilla.org/en-US/docs/Glossary/URI)) used throughout [HTTP](HTTP.md) for identifying resources.
|
||||
|
||||
|
@ -15,19 +16,19 @@ URLs can be absolute like the above or relative like `../parent/path`.
|
|||
## Scheme or Protocol
|
||||
`http://` is the protocol. It indicates which protocol the browser must use. Usually it is the [HTTP](HTTP.md) protocol or its secured version, HTTPS. The Web requires one of these two, but browsers also know how to handle other protocols such as `mailto:` (to open a mail client) or `ftp:` to handle a file transfer, so don't be surprised if you see such protocols. Common schemes are:
|
||||
|
||||
| Scheme | Description | |
|
||||
| ----------- | ------------------------------------------------------------------------------------------------- | --- |
|
||||
| data | [Data URLs](Data%20URLs.md) | |
|
||||
| file | Host-specific file names | |
|
||||
| ftp | [File Transfer Protocol](https://developer.mozilla.org/en-US/docs/Glossary/FTP) | |
|
||||
| http/https | [Hyper text transfer protocol (Secure)](https://developer.mozilla.org/en-US/docs/Glossary/HTTP) | |
|
||||
| javascript | URL-embedded JavaScript code | |
|
||||
| mailto | Electronic mail address | |
|
||||
| ssh | Secure shell | |
|
||||
| tel | telephone | |
|
||||
| urn | Uniform Resource Names | |
|
||||
| view-source | Source code of the resource | |
|
||||
| ws/wss | [WebSocket connections (Secure)](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) | |
|
||||
| Scheme | Description |
|
||||
| ----------- | ------------------------------------------------------------------------------------------------- |
|
||||
| data | [Data URLs](Data%20URLs.md) |
|
||||
| file | Host-specific file names |
|
||||
| ftp | [File Transfer Protocol](https://developer.mozilla.org/en-US/docs/Glossary/FTP) |
|
||||
| http/https | [Hyper text transfer protocol (Secure)](https://developer.mozilla.org/en-US/docs/Glossary/HTTP) |
|
||||
| javascript | URL-embedded JavaScript code |
|
||||
| mailto | Electronic mail address |
|
||||
| ssh | Secure shell |
|
||||
| tel | telephone |
|
||||
| urn | Uniform Resource Names |
|
||||
| view-source | Source code of the resource |
|
||||
| ws/wss | [WebSocket connections (Secure)](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) |
|
||||
|
||||
## Domain
|
||||
`www.example.com` is the [domain](Domain.md) name or authority that governs the namespace. It indicates which Web server is being requested. Alternatively, it is possible to directly use an [IP address](https://developer.mozilla.org/en-US/docs/Glossary/IP_Address), but because it is less convenient, it is not often used on the Web.
|
||||
|
@ -42,7 +43,4 @@ URLs can be absolute like the above or relative like `../parent/path`.
|
|||
`?key1=value1&key2=value2` are extra parameters provided to the Web server. Those parameters are a list of key/value pairs separated with the `&` symbol. The Web server can use those parameters to do extra stuff before returning the resource to the user. Each Web server has its own rules regarding parameters, and the only reliable way to know how a specific Web server is handling parameters is by asking the Web server owner.
|
||||
|
||||
## Fragment
|
||||
`#SomewhereInTheDocument` is an anchor to another part of the resource itself. An anchor represents a sort of "bookmark" inside the resource, giving the browser the directions to show the content located at that "bookmarked" spot. On an [HTML](HTML.md) document, for example, the browser will scroll to the point where the anchor is defined; on a video or audio document, the browser will try to go to the time the anchor represents. It is worth noting that the part after the #, also known as the fragment identifier, is never sent to the server with the request.
|
||||
|
||||
|
||||
|
||||
`#SomewhereInTheDocument` is an anchor to another part of the resource itself. An anchor represents a sort of "bookmark" inside the resource, giving the browser the directions to show the content located at that "bookmarked" spot. On an [HTML](HTML.md) document, for example, the browser will scroll to the point where the anchor is defined; on a video or audio document, the browser will try to go to the time the anchor represents. It is worth noting that the part after the `#`, also known as the fragment identifier, is never sent to the server with the request.
|
||||
|
|
Loading…
Reference in a new issue