Chapter One: Understanding Web and Network Fundamentals1.http: Hypertext Transfer Protocol2.TCP/IP protocol family: The network usually used is based on the TCP/IP protocol family, and HTTP belongs to a subset within it.The 3.TCP/IP protocol family is divided into the following layers: application layer, Transport layer, network layer, data link layer, respective
error or request not implemented5XX: Server-side error-the server failed to implement a legitimate requestCommon status codes, status descriptions, descriptions:200:ok//Client request succeeded400:bad request//client requests have syntax errors and cannot be understood by the server401:unauthorized//Request unauthorized, this status code must be used with the Www-authenticate header field403:forbidden//server receives request, but refuses to provide service404:not Found//Request resource not pr
OC basics: Class extension. Protocol
// When designing another class, some methods need to be made public (Interface), and some are for internal use only.
Class Extension: Add new features (attributes) or methods to the class.
For known classes:
1. Add directly
2. inherit (add instance variables and methods to its subclass)
3. Use extension (extensions to private methods and private properties (the methods
.
visibility
data in URL are visible to all.
data is not displayed in The URL.
Other HTTP Request MethodsSome other HTTP request methods are listed in the following table:
Method
Description
head
same as GET, However, only the HTTP header is returned and the document body is not returned.
put
upload the specified URI Said.
dele
can use host nameLocal loopback address: 127.0.0.1 host name: localhost2) port number (locator)The logical address used to mark the process, and the marking of the different processesValid ports: 0~65535, where 0~1024 is used by the system or reserved ports, do not use ports below 1024 in development3) Transfer Protocol (how to interact with it)Rules of CommunicationCommon protocols: TCP, UDP4) URL (Uniform Resource location) http://ip:80/file path5)
without waiting for a response. This makes it possible to send multiple requests simultaneously in parallel without waiting for a response one after the other.For example, when requesting an HTML Web page with 10 images, a persistent connection can make the request end faster than a single connection. Pipeline technology is faster than a durable connection. The more requests, the more obvious the time difference is.5 State management Using cookiesHTTP is a stateless
Challenge/response authentication mechanism.
Entity Header
There are many headers that can be used to describe the payload of an HTTP message. These headers may appear in both types of messages because the entity portion may be included in the request and response messages. The entity header provides a large amount of information about the entity and its content, from information about the object type to the various valid request methods that can be used on the resource. In su
/wKioL1nKIWOiVxRdAABjFnD7AY8390.png "title=" Qq20170926174356.png "alt=" Wkiol1nkiwoivxrdaabjfnd7ay8390.png "/>ExampleRequesturl:http://btn.siteuptime.com/genbutton.php?u=89773m=101594c=redp=totalrequest Method:GET Method of //Request statuscode:304notmodified //The status code returned by the conditional request remoteaddress:198.232.125.32:80 //server-side address Cache-Control:max-age=86400 //control cache is in effect connection:keep-alive //Connection Status date:tue,26sep 201709:51:09gmt//
re-sent. The time required in the TIME_WAIT state is dependent on the implementation method. Typical values are 30 seconds, 1 minutes, and 2 minutes. The connection is formally closed after waiting, and all resources (including the port number) are released."Question 1" Why is the handshake three times when it is connected and four times when it is closed?A: The syn+ack message can be sent directly after the server receives the SYN connection request message from the client side. Where the ACK
the server, which allows the server to create a document named after the request URL with the request principal, and if the document already exists, it will be replaced (that is, modified).Delete: Remove a resource on the serverTrace: Because HTTP in the process of request through the firewall, proxy, gateway and other applications, and each intermediate point can change the original HTTP request, so the role of trace is to bounce back a trace in the last station server, and the original reques
is also made up of three parts: status line, message header, response body1 status LineStatus code:The status code consists of three digits, the first number defines the category of the response, and there are five possible values:1XX: Indication information--Indicates that the request has been received and continues processing2XX: Success-Indicates that the request has been successfully received, understood, accepted3XX: Redirect--further action is required to complete the request4XX: Client E
One: Two versions of the HTTP protocolThere are two versions of the HTTP protocol: HTTP1.0 and HTTP1.1The main difference is that, in the HTTP1.0 protocol, after a client has established a connection with a Web server, only one Web resource can be obtained. And HTTP1.1 can get multiple resources.HTTP 1.0 Specifies that the browser and the server only maintain a brief connection, each request of the browser
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.