Lan Yi iOS network protocol API

Source: Internet
Author: User
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

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.