gitmyhub

asi-http-request

Objective-C ★ 5.7k updated 7y ago

Easy to use CFNetwork wrapper for HTTP requests, Objective-C, Mac OS X and iPhone

ASIHTTPRequest is a legacy Objective-C HTTP library for iOS and Mac OS X that wraps Apple's CFNetwork API to simplify networking, file uploads, caching, and authentication.

Objective-CCFNetworkiOSMac OS Xsetup: moderatecomplexity 2/5

ASIHTTPRequest is an Objective-C networking library for iOS and Mac OS X applications. It wraps Apple's lower-level CFNetwork API to make HTTP communication easier to write and manage. The library predates modern Apple networking tools (like NSURLSession) and was widely used during the early iOS development era.

The library handles the full range of HTTP operations: GET, POST, PUT, and DELETE requests. A companion class called ASIFormDataRequest handles multipart form submissions, making it straightforward to upload files from an iOS or Mac app the same way an HTML form would. Downloads can be written directly to disk rather than held in memory, which matters when fetching large files on devices with limited RAM.

Feature highlights include progress tracking for both uploads and downloads through native Apple progress controls, authentication support for Basic, Digest, and NTLM schemes with optional Keychain storage so credentials persist across sessions, cookie handling, GZIP compression, and bandwidth throttling. The library also includes ASIDownloadCache, which transparently caches server responses and lets cached pages load even when there is no network connection.

On iOS 4 and later, requests can continue running after the user switches away from the app. The library supports both synchronous and asynchronous request patterns and, on iOS 4 and Mac OS X 10.6, can notify about request state changes using blocks rather than delegate callbacks. Dedicated support classes exist for Amazon S3 and Rackspace Cloud Files storage.

The library targets Mac OS X 10.5 or later and iOS 3.0 or later. It comes with a unit test suite. The README does not mention a license. Note: this library is from the early iOS era and is no longer actively maintained; most modern iOS projects use NSURLSession or libraries built on top of it.

Where it fits