Files
youle_app_ios/Pods/Qiniu/QiniuSDK/Http/Request/QNHttpSingleRequest.h

43 lines
1.5 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//
// QNHttpRequest+SingleRequestRetry.h
// QiniuSDK
//
// Created by yangsen on 2020/4/29.
// Copyright © 2020 Qiniu. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "QNUploadRequestInfo.h"
#import "QNIUploadServer.h"
NS_ASSUME_NONNULL_BEGIN
@class QNUploadRequestState, QNResponseInfo, QNConfiguration, QNUploadOption, QNUpToken, QNUploadSingleRequestMetrics;
typedef void(^QNSingleRequestCompleteHandler)(QNResponseInfo * _Nullable responseInfo, NSArray <QNUploadSingleRequestMetrics *> * _Nullable metrics, NSDictionary * _Nullable response);
@interface QNHttpSingleRequest : NSObject
- (instancetype)initWithConfig:(QNConfiguration *)config
uploadOption:(QNUploadOption *)uploadOption
token:(QNUpToken *)token
requestInfo:(QNUploadRequestInfo *)requestInfo
requestState:(QNUploadRequestState *)requestState;
/// 网络请求
/// @param request 请求内容
/// @param server server信息目前仅用于日志统计
/// @param shouldRetry 判断是否需要重试的block
/// @param progress 上传进度回调
/// @param complete 上传完成回调
- (void)request:(NSURLRequest *)request
server:(id <QNUploadServer>)server
shouldRetry:(BOOL(^)(QNResponseInfo * _Nullable responseInfo, NSDictionary * _Nullable response))shouldRetry
progress:(void(^)(long long totalBytesWritten, long long totalBytesExpectedToWrite))progress
complete:(QNSingleRequestCompleteHandler)complete;
@end
NS_ASSUME_NONNULL_END