TCP: One-to-one guarantee data security arrives based on connection
UDP: can achieve high broadcast non-connected transmission efficiency (because no connection is established) does not guarantee the accurate arrival of data
HTTP: Hypertext Transfer Protocol
Socket: long-connected data transmission real-time, low development efficiency, high transmission efficiency, high demand for programmers, poor fault tolerance
HTTP: protocol for data transmission based on TCP connection protocol, high development efficiency, strong fault tolerance, low transmission efficiency (because every time with a variety of head data)
HTTP Polling: The client sends a request to the server every 10 seconds to ask if there is data, if the server has data directly to the client, if there is no data to wait 10 seconds to respond, if there is data in 10 seconds to respond to the client in a timely manner, the client immediately after receiving the response to send a request again
Will look at the interface document: 1. Interface address 2. Parameter Description 3. Request Method (Get/post) 4. return type (Xml/json) 5. Return Data Introduction
Interface Network SERVICE WEBAPI WebService Network API
Nsurlconnection: Obsolete
Nsurlsession: Objects for network sessions
Nsurlsession is divided into three tasks: 1 Data Task 2 download Task 3 upload task
Http://apis.juhe.cn/cook/query.php Primary and sub-addresses are differentiated by sub-address which interface
When using a GET request, URL encoding is required if the request parameter appears in Chinese
Get: Generally used to get data from the server, you need to put the request parameters at the back of the request address
POST: Generally used to upload data to the server, such as micro-blog upload files, need to put the request parameters in the request body
Afnetworking: A basic HTTP GET and POST request will be issued
Lan Yi iOS network protocol API