[Reading Notes] iOS-ASIHTTPRequest framework ., Iosasi framework

Source: Internet
Author: User

[Reading Notes] iOS-ASIHTTPRequest framework ., Iosasi framework

1. install and configure the ASIHTTPRequest framework.

2. synchronous requests.

In the ASIHTTPRequest framework, the HTTP request-related classes include ASIHTTPRequest and ASIFormDataRequest. The most common classes are ASIHTTPRequest and ASIFormDataRequest, which is a subclass of ASIHTTPRequest, you can also upload data. By default, you can use the POST request method or other HTTP request methods. Both of them can be asynchronous or synchronous requests.

1. Implement GET synchronization requests.

To implement GET synchronous requests, use the basic request class ASIHTTPRequest.

2. Implement POST synchronous requests.

Requests that send POST methods use the ASIFormDataReques class for both non-and asynchronous requests, except that they are slightly different.

3. asynchronous requests.

A synchronization request is generally used only in a child thread, but not in the main thread. The user experience of asynchronous requests is better than that of synchronous requests. Therefore, asynchronous requests generally use a lot.

4. Example: The request queue should be.

For the network capability of multi-threaded concurrent requests, ASIHTTPRequest is designed as the NSOperation subclass, and ASINetworkQueue is designed as the NSOperationQueue subclass.

V. Example: Upload a data application.

 

Reference: iOS network programming and cloud applications-Best Practices

Related Article

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.