FWNetworkConfig

@interface FWNetworkConfig : NSObject

FWNetworkConfig stored global network-related configurations, which will be used in FWNetworkAgent to form and filter requests, as well as caching response.

  • Unavailable

    Undocumented

    Declaration

    Objective-C

    - (instancetype)init NS_UNAVAILABLE;
  • Unavailable

    Undocumented

    Declaration

    Objective-C

    + (instancetype)new NS_UNAVAILABLE;
  • Return a shared config object.

    Declaration

    Objective-C

    + (nonnull FWNetworkConfig *)sharedConfig;
  • Request base URL, such as “http://www.yuantiku.com”. Default is empty string.

    Declaration

    Objective-C

    @property (nonatomic, strong) NSString *_Nonnull baseUrl;
  • Request CDN URL. Default is empty string.

    Declaration

    Objective-C

    @property (nonatomic, strong) NSString *_Nonnull cdnUrl;
  • URL filters. See also FWUrlFilterProtocol.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<id<FWUrlFilterProtocol>> *_Nonnull urlFilters;
  • Cache path filters. See also FWCacheDirPathFilterProtocol.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<id<FWCacheDirPathFilterProtocol>> *_Nonnull cacheDirPathFilters;
  • Security policy will be used by AFNetworking. See also FWSecurityPolicy.

    Declaration

    Objective-C

    @property (nonatomic, strong) FWSecurityPolicy *_Nonnull securityPolicy;
  • Whether to remove NSNull values from response JSON. Defaults to NO.

    Declaration

    Objective-C

    @property (nonatomic) BOOL removeNullValues;
  • Whether to log debug info. Default is NO;

    Declaration

    Objective-C

    @property (nonatomic) BOOL debugLogEnabled;
  • Whether to enable mock response when failed in debug mode. Default is NO.

    Declaration

    Objective-C

    @property (nonatomic) BOOL debugMockEnabled;
  • SessionConfiguration will be used to initialize FWHTTPSessionManager. Default is nil.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSURLSessionConfiguration *sessionConfiguration;
  • NSURLSessionTaskMetrics

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) void (^) (NSURLSession *_Nonnull __strong, NSURLSessionTask *_Nonnull __strong, NSURLSessionTaskMetrics *_Nullable __strong) collectingMetricsBlock;
  • Add a new URL filter.

    Declaration

    Objective-C

    - (void)addUrlFilter:(nonnull id<FWUrlFilterProtocol>)filter;
  • Remove all URL filters.

    Declaration

    Objective-C

    - (void)clearUrlFilter;
  • Add a new cache path filter

    Declaration

    Objective-C

    - (void)addCacheDirPathFilter:(nonnull id<FWCacheDirPathFilterProtocol>)filter;
  • Clear all cache path filters.

    Declaration

    Objective-C

    - (void)clearCacheDirPathFilter;