ASIHTTPRequest vs AFNetworking vs NSUrlRequest

前端 未结 4 622
名媛妹妹
名媛妹妹 2021-02-01 03:29

In the past I have use ASIHTTPRequest but now there is NSURLRequest. Should we be using the NSURLRequest now? Are there any disadvantages

4条回答
  •  耶瑟儿~
    2021-02-01 04:09

    NSURLConnection and NSURLRequest are the provided Cocoa classes for managing connections. In iOS 7, Apple added NSURLSession.

    But I think you'll find AFNetworking to be a framework that further simplifies network requests (notably complex HTTP requests). If you don't want to use third-party frameworks for any reason, you can use NSURLConnection and/or NSURLSession directly. It just takes a little more coding.

    If you're looking for a good ASIHTTPRequest alternative, AFNetworking is a great candidate.

    For information on NSURLConnection and NSURLSession see the URL Loading System Programming Guide.

提交回复
热议问题