KS3ServiceRequest.h
2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// KingSoftServiceRequest.h
// KS3SDK
//
// Created by JackWong on 12/9/14.
// Copyright (c) 2014 kingsoft. All rights reserved.
//
#import "KS3Credentials.h"
#import "KS3URLRequest.h"
#import <Foundation/Foundation.h>
@class KS3ServiceResponse;
@class KS3ClientException;
@protocol KingSoftServiceRequestDelegate;
@interface KS3ServiceRequest : NSObject
@property(strong, nonatomic) KS3Credentials *credentials;
@property(strong, nonatomic) KS3URLRequest *urlRequest;
@property(strong, nonatomic) NSString *httpMethod;
@property(strong, nonatomic) NSURLConnection *urlConnection;
@property(strong, readonly, nonatomic) NSURL *url;
@property(strong, nonatomic) NSString *host;
@property(strong, nonatomic) NSString *contentMd5;
@property(strong, nonatomic) NSString *contentType;
@property(strong, nonatomic) NSString *kSYResource;
@property(strong, nonatomic) NSDate *requestDate;
@property(strong, nonatomic) NSString *strDate;
@property(nonatomic, strong) NSString *strKS3Token;
@property NSTimeInterval timeoutInterval;
@property(weak, nonatomic) id<KingSoftServiceRequestDelegate> delegate;
- (KS3URLRequest *)configureURLRequest;
- (void)sign;
- (KS3ClientException *)validate;
- (void)cancel;
- (NSString *)URLEncodedString:(NSString *)str;
- (void)setCompleteRequest;
- (NSString *)kSYHeader;
@end
@protocol KingSoftServiceRequestDelegate <NSObject>
@optional
- (void)request:(KS3ServiceRequest *)request
didReceiveResponse:(NSURLResponse *)response;
- (void)request:(KS3ServiceRequest *)request didReceiveData:(NSData *)data;
- (void)request:(KS3ServiceRequest *)request
didCompleteWithResponse:(KS3ServiceResponse *)response;
- (void)request:(KS3ServiceRequest *)request
didSendData:(long long)bytesWritten
totalBytesWritten:(long long)totalBytesWritten
totalBytesExpectedToWrite:(long long)totalBytesExpectedToWrite;
- (void)request:(KS3ServiceRequest *)request didFailWithError:(NSError *)error;
- (void)request:(KS3ServiceRequest *)request
didFailWithServiceException:(NSException *)exception
__attribute__((deprecated));
@end