Constants
The following constants are available globally.
-
Posted when network reachability changes. This notification assigns no notification object. The
userInfo
dictionary contains anNSNumber
object under theAFNetworkingReachabilityNotificationStatusItem
key, representing theAFNetworkReachabilityStatus
value for the current network reachability.Warning
In order for network reachability to be monitored, include theSystemConfiguration
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
-
Error Domains
The following error domain is predefined.
NSString * const AFURLRequestSerializationErrorDomain
Constants
AFURLRequestSerializationErrorDomain
AFURLRequestSerializer errors. Error codes forAFURLRequestSerializationErrorDomain
correspond to codes inNSURLErrorDomain
.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 anNSURLRequest
containing the request of the operation associated with an error. This key is only present in theAFURLRequestSerializationErrorDomain
.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 forAFURLResponseSerializationErrorDomain
correspond to codes inNSURLErrorDomain
.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 anNSURLResponse
containing the response of the operation associated with an error. This key is only present in theAFURLResponseSerializationErrorDomain
.AFNetworkingOperationFailingURLResponseDataErrorKey
The corresponding value is anNSData
containing the original data of the operation associated with an error. This key is only present in theAFURLResponseSerializationErrorDomain
.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
-
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