QCloudGetPresignedURLRequest.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. //
  2. // QCloudGetPresignedURLRequest.h
  3. // QCloudCOSXML
  4. //
  5. // Created by erichmzhang(张恒铭) on 17/01/2018.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import <QCloudCore/QCloudCore.h>
  9. #import "QCloudGetPresignedURLResult.h"
  10. NS_ASSUME_NONNULL_BEGIN
  11. @interface QCloudGetPresignedURLRequest :QCloudBizHTTPRequest
  12. /**
  13. 填入使用预签名请求的Bucket
  14. */
  15. @property (nonatomic, copy) NSString* bucket;
  16. /**
  17. 填入对应的Object
  18. */
  19. @property (nonatomic, copy) NSString* object;
  20. /**
  21. 填入使用预签名URL的请求的HTTP方法。有效值(大小写敏感)为:@"GET",@"PUT",@"POST",@"DELETE"
  22. */
  23. @property (nonatomic, copy) NSString* HTTPMethod;
  24. /**
  25. 如果使用预签名URL的请求有该头部,那么通过这里设置
  26. */
  27. @property (nonatomic, readonly) NSString* contentType;
  28. /**
  29. 如果使用预签名URL的请求有该头部,那么通过这里设置
  30. */
  31. @property (nonatomic, readonly) NSString* contentMD5;
  32. @property (nonatomic, readonly) NSDictionary<NSString *, NSString *> *requestHeaders;
  33. @property (nonatomic, readonly) NSDictionary<NSString *, NSString *> *requestParameters;
  34. /**
  35. 添加使用预签名请求的头部
  36. @param value HTTP header的值
  37. @param requestHeader HTTP header的key
  38. */
  39. - (void)setValue:(NSString * _Nullable)value forRequestHeader:(NSString *_Nullable)requestHeader;
  40. /**
  41. 添加使用预签名请求的URL参数
  42. @param value 参数的值
  43. @param requestParameter 参数的key
  44. */
  45. - (void)setValue:(NSString * _Nullable)value forRequestParameter:(NSString *_Nullable)requestParameter;
  46. /**
  47. 设置完成回调。请求完成后会通过该回调来获取结果,如果没有error,那么可以认为请求成功。
  48. @param finishBlock 请求完成回调
  49. */
  50. - (void) setFinishBlock:(void(^)(QCloudGetPresignedURLResult* result, NSError* error))finishBlock;
  51. @end
  52. NS_ASSUME_NONNULL_END