Gjm:unity3d Common network Framework and practical analysis of "notes"

Source: Internet
Author: User

Unity Common Network Framework and actual combat analysis
1.Http protocol
HTTP protocol
exists above TCP sometimes tls\ssl default port above HTTPS default port is 443
HTTP Request Response Model HTTP protocol is always the client sends the request, the server side will send the response
HTTP Workflow 1. Connection 2. Request 3. Response (Response)
HTTP request Response Message
Request requests
Request Message Format
Request line Generic message touch| request Header | Font header
Request Line = method "Space" HRL "space" version number "carriage return line"
Common Request Methods (get| Post)
Responnse response
Request Message Format
General Message Header Response Header entity header
HTTP status Code
Status code
1XX: Indicates that the request has been accepted and continues processing
2XX: Accept Request
3XX: Redirect, you must take a closer step to complete the request
4XX: Client error, request syntax error or request not implemented
5XX: Server Error
Common Status Codes
Ok
The Bad Request
401 Unauthorized Server not authorized
403 Forbidden Forbidden
404 Not Found
Internal Server Error
503 Server Unavailabl
The difference between 2.Get and POST request modes
Get is a form value passed through a URL, and the form value that is passed by post is implicit in the HTTP message, which is not visible in the URL.
Get request format for passing data by URL
The file name requested in the URL followed by "? ", and then add the message to be uploaded key and value values
Multiple sets of key-value pairs, with "&" between key-value pairs
The URL contains Chinese characters, special symbols, which need to be encoded.
Get passes the amount of data is limited, if you want to pass a large amount of data can not be used to get, to use post.
Get
Advantages: Easy to test, simple and clear
Cons: Less information, less security
Post
Advantages: Large amount of information, relatively high security
Cons: Test not very convenient

Gjm:unity3d Common network Framework and practical analysis of "notes"

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.