* Is this being used in any apps in the App Store currently by you? (or Panic?)
* Is Alamofire a non-profit or some kind of organization? Curious why it's listed in the README.
* Perhaps a bit deeper: Why a rewrite of AFNetworking's feature set instead of a AFN 3.0?
Was there any reason why you chose callbacks over a Promise-like pattern for the async responses?
Also do you know of any good HTTP Server libraries that will let you develop simple HTTP JSON services in Swift?
Deeply-nested networking callbacks are a code smell, and I find that promises often do more harm by hiding those smells—or worse, obscuring the flow itself. In practice, Alamofire is mostly going to be single or at most nested two levels deep anyway.
Thanks for your work by the way.
Alamofire.request(.GET, "http://httpbin.org/get")
.header("custom-header", "value")The long answer: Custom headers on a per-request basis are a bit of a red herring, from an API design perspective. In reality, most use cases boil down to one of three, which are taken care of in other ways:
- Default headers, such as `User-Agent`, are specified in `NSURLSessionConfiguration -HTTPAdditionalHeaders`. - `Authorization` headers, which are handled by `NSURLCredential` and `NSURLAuthenticationChallenge`. - `Content-Type` headers, which are handled by `ParameterEncoding`.
This is why Alamofire is designed the way it is.