Constants

The following constants are available globally.

Notifications

  • Posted when network reachability changes. This notification assigns no notification object. The userInfo dictionary contains an NSNumber object under the AFNetworkingReachabilityNotificationStatusItem key, representing the AFNetworkReachabilityStatus value for the current network reachability.

    Warning

    In order for network reachability to be monitored, include the SystemConfiguration framework in the active target’s “Link Binary With Library” build phase, and add #import <SystemConfiguration/SystemConfiguration.h> to the header prefix of the project (Prefix.pch).

    Declaration

    Objective-C

    extern NSString *const _Nonnull AFNetworkingReachabilityDidChangeNotification

    Swift

    static let AFNetworkingReachabilityDidChange: NSNotification.Name
  • Undocumented

    Declaration

    Objective-C

    FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityNotificationStatusItem

    Swift

    let AFNetworkingReachabilityNotificationStatusItem: String

Constants

  • Error Domains

    The following error domain is predefined.

    • NSString * const AFURLRequestSerializationErrorDomain

    Constants

    AFURLRequestSerializationErrorDomain AFURLRequestSerializer errors. Error codes for AFURLRequestSerializationErrorDomain correspond to codes in NSURLErrorDomain.

    Declaration

    Objective-C

    extern NSString *const _Nonnull AFURLRequestSerializationErrorDomain

    Swift

    let AFURLRequestSerializationErrorDomain: String
  • User info dictionary keys

    These keys may exist in the user info dictionary, in addition to those defined for NSError.

    • NSString * const AFNetworkingOperationFailingURLRequestErrorKey

    Constants

    AFNetworkingOperationFailingURLRequestErrorKey The corresponding value is an NSURLRequest containing the request of the operation associated with an error. This key is only present in the AFURLRequestSerializationErrorDomain.

    Declaration

    Objective-C

    extern NSString *const _Nonnull AFNetworkingOperationFailingURLRequestErrorKey

    Swift

    let AFNetworkingOperationFailingURLRequestErrorKey: String
  • Throttling Bandwidth for HTTP Request Input Streams

    See

    -throttleBandwidthWithPacketSize:delay:

    Constants

    kAFUploadStream3GSuggestedPacketSize Maximum packet size, in number of bytes. Equal to 16kb.

    kAFUploadStream3GSuggestedDelay Duration of delay each time a packet is read. Equal to 0.2 seconds.

    Declaration

    Objective-C

    extern const NSUInteger kAFUploadStream3GSuggestedPacketSize

    Swift

    let kAFUploadStream3GSuggestedPacketSize: UInt
  • Undocumented

    Declaration

    Objective-C

    FOUNDATION_EXPORT NSTimeInterval const kAFUploadStream3GSuggestedDelay

    Swift

    let kAFUploadStream3GSuggestedDelay: TimeInterval
  • Error Domains

    The following error domain is predefined.

    • NSString * const AFURLResponseSerializationErrorDomain

    Constants

    AFURLResponseSerializationErrorDomain AFURLResponseSerializer errors. Error codes for AFURLResponseSerializationErrorDomain correspond to codes in NSURLErrorDomain.

    Declaration

    Objective-C

    extern NSString *const _Nonnull AFURLResponseSerializationErrorDomain

    Swift

    let AFURLResponseSerializationErrorDomain: String
  • User info dictionary keys

    These keys may exist in the user info dictionary, in addition to those defined for NSError.

    • NSString * const AFNetworkingOperationFailingURLResponseErrorKey
    • NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey

    Constants

    AFNetworkingOperationFailingURLResponseErrorKey The corresponding value is an NSURLResponse containing the response of the operation associated with an error. This key is only present in the AFURLResponseSerializationErrorDomain.

    AFNetworkingOperationFailingURLResponseDataErrorKey The corresponding value is an NSData containing the original data of the operation associated with an error. This key is only present in the AFURLResponseSerializationErrorDomain.

    Declaration

    Objective-C

    extern NSString *const _Nonnull AFNetworkingOperationFailingURLResponseErrorKey

    Swift

    let AFNetworkingOperationFailingURLResponseErrorKey: String
  • Undocumented

    Declaration

    Objective-C

    FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey

    Swift

    let AFNetworkingOperationFailingURLResponseDataErrorKey: String

Notifications

  • Posted when a task resumes.

    Declaration

    Objective-C

    extern NSString *const _Nonnull AFNetworkingTaskDidResumeNotification

    Swift

    static let AFNetworkingTaskDidResume: NSNotification.Name
  • Posted when a task finishes executing. Includes a userInfo dictionary with additional information about the task.

    Declaration

    Objective-C

    extern NSString *const _Nonnull AFNetworkingTaskDidCompleteNotification

    Swift

    static let AFNetworkingTaskDidComplete: NSNotification.Name
  • Posted when a task suspends its execution.

    Declaration

    Objective-C

    extern NSString *const _Nonnull AFNetworkingTaskDidSuspendNotification

    Swift

    static let AFNetworkingTaskDidSuspend: NSNotification.Name
  • Posted when a session is invalidated.

    Declaration

    Objective-C

    extern NSString *const _Nonnull AFURLSessionDidInvalidateNotification

    Swift

    static let AFURLSessionDidInvalidate: NSNotification.Name
  • Posted when a session download task finished moving the temporary download file to a specified destination successfully.

    Declaration

    Objective-C

    extern NSString
        *const _Nonnull AFURLSessionDownloadTaskDidMoveFileSuccessfullyNotification

    Swift

    static let AFURLSessionDownloadTaskDidMoveFileSuccessfully: NSNotification.Name
  • Posted when a session download task encountered an error when moving the temporary download file to a specified destination.

    Declaration

    Objective-C

    extern NSString
        *const _Nonnull AFURLSessionDownloadTaskDidFailToMoveFileNotification

    Swift

    static let AFURLSessionDownloadTaskDidFailToMoveFile: NSNotification.Name
  • The raw response data of the task. Included in the userInfo dictionary of the AFNetworkingTaskDidCompleteNotification if response data exists for the task.

    Declaration

    Objective-C

    extern NSString *const _Nonnull AFNetworkingTaskDidCompleteResponseDataKey

    Swift

    let AFNetworkingTaskDidCompleteResponseDataKey: String
  • The serialized response object of the task. Included in the userInfo dictionary of the AFNetworkingTaskDidCompleteNotification if the response was serialized.

    Declaration

    Objective-C

    extern NSString *const _Nonnull AFNetworkingTaskDidCompleteSerializedResponseKey

    Swift

    let AFNetworkingTaskDidCompleteSerializedResponseKey: String
  • The response serializer used to serialize the response. Included in the userInfo dictionary of the AFNetworkingTaskDidCompleteNotification if the task has an associated response serializer.

    Declaration

    Objective-C

    extern NSString *const _Nonnull AFNetworkingTaskDidCompleteResponseSerializerKey

    Swift

    let AFNetworkingTaskDidCompleteResponseSerializerKey: String
  • The file path associated with the download task. Included in the userInfo dictionary of the AFNetworkingTaskDidCompleteNotification if an the response data has been stored directly to disk.

    Declaration

    Objective-C

    extern NSString *const _Nonnull AFNetworkingTaskDidCompleteAssetPathKey

    Swift

    let AFNetworkingTaskDidCompleteAssetPathKey: String
  • Any error associated with the task, or the serialization of the response. Included in the userInfo dictionary of the AFNetworkingTaskDidCompleteNotification if an error exists.

    Declaration

    Objective-C

    extern NSString *const _Nonnull AFNetworkingTaskDidCompleteErrorKey

    Swift

    let AFNetworkingTaskDidCompleteErrorKey: String
  • The session task metrics taken from the download task. Included in the userInfo dictionary of the AFNetworkingTaskDidCompleteSessionTaskMetrics

    Declaration

    Objective-C

    extern NSString *const _Nonnull AFNetworkingTaskDidCompleteSessionTaskMetrics

    Swift

    let AFNetworkingTaskDidCompleteSessionTaskMetrics: String