AFNetworking最新版本包含以下幾部分:

第一部分:AFSecurityPolicy.m
AFN提供的三種安全策略:
typedef NS_ENUM(NSUInteger, AFSSLPinningMode) {
? ? AFSSLPinningModeNone,//無校驗
? ? AFSSLPinningModePublicKey,//公鑰校驗
? ? AFSSLPinningModeCertificate,//證書校驗
};
三個類方法初始化安全策略:
//默認的安全策略,不允許無效的證書,需要驗證域名,不會對固定的證書和公鑰做校驗;
+ (instancetype)defaultPolicy;
//創(chuàng)建并返回一個指定安全模式的策略;
+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode;
//創(chuàng)建并返回一個指定安全模式并綁定證書的安全策略。
+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet <NSData *> *)pinnedCertificates;
第二部分:AFNetworkReachabilityManager.m
AFN提供的四種網絡狀態(tài):
typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) {
? ? AFNetworkReachabilityStatusUnknown? ? ? ? ? = -1,//未知網絡
? ? AFNetworkReachabilityStatusNotReachable? ? = 0,//沒網絡
? ? AFNetworkReachabilityStatusReachableViaWWAN = 1,//蜂窩網絡
? ? AFNetworkReachabilityStatusReachableViaWiFi = 2,//wifi
};
五種初始化方式:
//返回有默認套接字地址的網絡管理器單例;
+ (instancetype)sharedManager;
//返回有默認套接字地址的網絡管理器;
+ (instancetype)manager;
//返回有指定域的網絡管理器;
+ (instancetype)managerForDomain:(NSString *)domain;
//創(chuàng)建并返回具有自定義套接字地址的網絡管理器
+ (instancetype)managerForAddress:(const void *)address;
//通過系統(tǒng)的網絡檢測對象初始化網絡管理器
+ (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER;
網絡狀態(tài)改變時,block回調:
- (void)setReachabilityStatusChangeBlock:(nullable void (^)(AFNetworkReachabilityStatus status))block;
第三部分:AFURLRequestSerialization.m
暫定一種HTTP請求序列化類型:
typedef NS_ENUM(NSUInteger, AFHTTPRequestQueryStringSerializationStyle) {
? ? AFHTTPRequestQueryStringDefaultStyle = 0,
};
AFURLRequestSerialization協議:返回一個帶指定參數的序列化請求。
AFHTTPRequestSerializer類(遵守AFURLRequestSerialization協議):
對序列化參數進行編碼、是否可以用手機流量創(chuàng)建網絡、創(chuàng)建請求的緩存策略、創(chuàng)建cookies處理方式、是否在接收請求響應之前繼續(xù)發(fā)送請求、設置超時時間、設置獲取請求頭信息、設置清除http auth信息、默認和自定義查詢字符串序列化方法。
三種創(chuàng)建并返回可變url請求的方法:
//默認方法
- (NSMutableURLRequest *)requestWithMethod:(NSString *)method
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? URLString:(NSString *)URLString
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? error:(NSError * _Nullable __autoreleasing *)error;
//自定義block方法
- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? URLString:(NSString *)URLString
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? parameters:(nullable NSDictionary <NSString *, id> *)parameters
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> formData))block
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? error:(NSError * _Nullable __autoreleasing *)error;
//刪除HTTPBodySteam
- (NSMutableURLRequest *)requestWithMultipartFormRequest:(NSURLRequest *)request
? ? ? ? ? ? ? ? ? ? ? ? ? ? writingStreamContentsToFile:(NSURL *)fileURL
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? completionHandler:(nullable void (^)(NSError * _Nullable error))handler;
AFJSONRequestSerializer:專門用來處理類型為json的請求
AFPropertyListRequestSerializer:專門用來處理類型為x-plist的請求
第四部分:AFURLResponseSerialization.m
AFURLResponseSerialization協議:返回一個帶指定參數的序列化響應協議
AFHTTPResponseSerializer類:初始化響應類、設置響應可接受的狀態(tài)碼、設置響應可接受的Content - Type類型、是否返回有效的響應
AFJSONResponseSerializer:檢驗和解碼application/json、text/json、text/javascript類型的響應
AFXMLParserResponseSerializer:檢驗和解碼application/xml、text/xml類型的響應
AFXMLDocumentResponseSerializer:檢驗和解碼application/xml、text/xml文檔類型的響應
AFPropertyListResponseSerializer:檢驗和解碼x-plist類型的響應
AFImageResponseSerializer:檢驗和解碼UIImage和NSImage類型的響應
AFCompoundResponseSerializer:檢驗和解碼多種潛在類型的響應
第五部分:AFURLSessionManager.m
兩種初始化方法:
//根據配置信息初始化網絡會話
- (instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)configuration;
//配置信息為nil,初始化網絡會話
- (instancetype)init;
取消網絡操作:
//是否取消任務,使網絡會話失效
- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks;
創(chuàng)建普通網絡會話:
//根據請求信息創(chuàng)建網絡會話
- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request
? ? ? ? ? ? ? ? ? ? ? ? ? ? completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject,? NSError * _Nullable error))completionHandler DEPRECATED_ATTRIBUTE;
//根據請求信息創(chuàng)建可以查詢上傳、下載進度的網絡會話? ? ? ? ? ? ? ? ? ? ? ? ? ?
- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? uploadProgress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock
? ? ? ? ? ? ? ? ? ? ? ? ? ? downloadProgress:(nullable void (^)(NSProgress *downloadProgress))downloadProgressBlock
? ? ? ? ? ? ? ? ? ? ? ? ? ? completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject,? NSError * _Nullable error))completionHandler;
創(chuàng)建上傳網絡會話:
//根據請求信息和文件url創(chuàng)建可以查詢上傳進度的網絡會話
- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? fromFile:(NSURL *)fileURL
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError? * _Nullable error))completionHandler;
//根據請求信息和要上傳的數據創(chuàng)建可以查詢上傳進度的網絡會話? ? ? ? ? ?
- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? fromData:(nullable NSData *)bodyData
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler;
//根據請求和輸入流創(chuàng)建可以查詢上傳進度的網絡會話
- (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler;
設置網絡請求的回調:
//設置會話失效時回調的block
- (void)setSessionDidBecomeInvalidBlock:(nullable void (^)(NSURLSession *session, NSError *error))block;
//設置對接收到的http auth進行校驗時,回調的block。
- (void)setSessionDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * _Nullable __autoreleasing * _Nullable credential))block;
//設置新的輸入流時,回調的block。
- (void)setTaskNeedNewBodyStreamBlock:(nullable NSInputStream * (^)(NSURLSession *session, NSURLSessionTask *task))block;
//設置HTTP重定向時,回調的block。
- (void)setTaskWillPerformHTTPRedirectionBlock:(nullable NSURLRequest * _Nullable (^)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request))block;
//設置對接收到的http auth進行校驗時,回調的block。
- (void)setTaskDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * _Nullable __autoreleasing * _Nullable credential))block;
//設置發(fā)送的數據時,回調的block。
- (void)setTaskDidSendBodyDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend))block;
//完成網絡任務時進行設置
- (void)setTaskDidCompleteBlock:(nullable void (^)(NSURLSession *session, NSURLSessionTask *task, NSError * _Nullable error))block;
//接收到響應時,回調block
- (void)setDataTaskDidReceiveResponseBlock:(nullable NSURLSessionResponseDisposition (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response))block;
//當下載任務完成時,設置網絡任務
- (void)setDataTaskDidBecomeDownloadTaskBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLSessionDownloadTask *downloadTask))block;
//當數據接收到時,設置網絡任務
- (void)setDataTaskDidReceiveDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSData *data))block;
//臨時緩存時設置任務
- (void)setDataTaskWillCacheResponseBlock:(nullable NSCachedURLResponse * (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSCachedURLResponse *proposedResponse))block;
//當所有的任務發(fā)送出去以后,回調block
- (void)setDidFinishEventsForBackgroundURLSessionBlock:(nullable void (^)(NSURLSession *session))block;
//當下載任務完成時,回調block
- (void)setDownloadTaskDidFinishDownloadingBlock:(nullable NSURL * _Nullable? (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location))block;
//下載時,寫入數據的回調block
- (void)setDownloadTaskDidWriteDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite))block;
//設置斷點續(xù)傳的block
- (void)setDownloadTaskDidResumeBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t fileOffset, int64_t expectedTotalBytes))block;
第六部分:AFHTTPSessionManager.m
四種初始化方法:
//url和配置信息都是nil
+ (instancetype)manager;
//url和配置信息都是nil
+ (instancetype)init;
//配置信息是nil
- (instancetype)initWithBaseURL:(nullable NSURL *)url;
//url是nil
- (instancetype)initWithBaseURL:(nullable NSURL *)url
? ? ? ? ? sessionConfiguration:(nullable NSURLSessionConfiguration *)configuration;
//url和配置信息都是nil
+ (instancetype)manager;
//url和配置信息都是nil
+ (instancetype)init;
//配置信息是nil
- (instancetype)initWithBaseURL:(nullable NSURL *)url;
//url是nil
- (instancetype)initWithBaseURL:(nullable NSURL *)url
? ? ? ? ? sessionConfiguration:(nullable NSURLSessionConfiguration *)configuration;
網絡請求方法[Get,Post,Put,Patch,Delete,Head]:
//GET請求
- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString
? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
//可查詢下載進度的GET請求
- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString
? ? ? ? ? ? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgress
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
//HEAD請求
- (nullable NSURLSessionDataTask *)HEAD:(NSString *)URLString
? ? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task))success
? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
//POST請求
- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
? ? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
//可查詢上傳進度的POST請求
- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
? ? ? ? ? ? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
//根據表單類型,構建POST網絡請求
- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
? ? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> formData))block
? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
//PUT請求
- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
? ? ? ? ? ? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? ? ? ? ? ? constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> formData))block
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;//根據表單類型,構建POST網絡請求,可查詢上傳進度
- (nullable NSURLSessionDataTask *)PUT:(NSString *)URLString
? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
//PATCH請求
- (nullable NSURLSessionDataTask *)PATCH:(NSString *)URLString
? ? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
? ? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
//DELETE請求
- (nullable NSURLSessionDataTask *)DELETE:(NSString *)URLString
? ? ? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
? ? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
//GET請求
- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString
? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
//可查詢下載進度的GET請求
- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString
? ? ? ? ? ? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgress
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
//HEAD請求
- (nullable NSURLSessionDataTask *)HEAD:(NSString *)URLString
? ? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task))success
? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
//POST請求
- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
? ? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
//可查詢上傳進度的POST請求
- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
? ? ? ? ? ? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
//根據表單類型,構建POST網絡請求
- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
? ? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> formData))block
? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
//PUT請求
- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
? ? ? ? ? ? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? ? ? ? ? ? constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> formData))block
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;//根據表單類型,構建POST網絡請求,可查詢上傳進度
- (nullable NSURLSessionDataTask *)PUT:(NSString *)URLString
? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
//PATCH請求
- (nullable NSURLSessionDataTask *)PATCH:(NSString *)URLString
? ? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
? ? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
//DELETE請求
- (nullable NSURLSessionDataTask *)DELETE:(NSString *)URLString
? ? ? ? ? ? ? ? ? ? ? parameters:(nullable id)parameters
? ? ? ? ? ? ? ? ? ? ? ? success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
? ? ? ? ? ? ? ? ? ? ? ? failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;