Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lovemo/suimvvmnetwork
SUIMVVMKit -- SUIMVVMNetwork
https://github.com/lovemo/suimvvmnetwork
Last synced: 7 days ago
JSON representation
SUIMVVMKit -- SUIMVVMNetwork
- Host: GitHub
- URL: https://github.com/lovemo/suimvvmnetwork
- Owner: lovemo
- License: mit
- Created: 2016-03-02T05:13:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-25T02:12:58.000Z (over 7 years ago)
- Last Synced: 2024-10-10T04:32:51.692Z (about 1 month ago)
- Language: Objective-C
- Size: 185 KB
- Stars: 9
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SUIMVVMNetwork
SUIMVVMKit -- SUIMVVMNetwork---
## usage
```
pod 'SUIMVVMNetwork'
```
---## introduction
```objc
@interface SMKHttp : NSObject
/**
* 请求超时时间
*/
@property (nonatomic, assign) NSTimeInterval timeoutInterval;/**
* 创建单例对象
*/
+ (instancetype)defaultHttp;/**
* 移除所有缓存
*/
+ (void)removeAllCaches;/**
* 取消所有网络请求
*/
+ (void)cancelAllOperations;/**
* GET请求 - 默认 MVVMHttpReloadIgnoringLocalCacheData 的缓存方式
*/
+ (void)get:(NSString *)url
params:(NSDictionary *)params
success:(requestSuccessBlock)successHandler
failure:(requestFailureBlock)failureHandler;/**
* POST请求 - 默认 MVVMHttpReloadIgnoringLocalCacheData 的缓存方式
*/
+ (void)post:(NSString *)url
params:(NSDictionary *)params
success:(requestSuccessBlock)successHandler
failure:(requestFailureBlock)failureHandler;/**
* GET请求
*/
+ (void)get:(NSString *)url
params:(NSDictionary *)params
cachePolicy:(SMKHttpRequestCachePolicy)cachePolicy
success:(requestSuccessBlock)successHandler
failure:(requestFailureBlock)failureHandler;/**
* POST请求
*/
+ (void)post:(NSString *)url
params:(NSDictionary *)params
cachePolicy:(SMKHttpRequestCachePolicy)cachePolicy
success:(requestSuccessBlock)successHandler
failure:(requestFailureBlock)failureHandler;/**
* PUT请求
*/
+ (void)put:(NSString *)url
params:(NSDictionary *)params
success:(requestSuccessBlock)successHandler
failure:(requestFailureBlock)failureHandler;/**
* DELETE请求
*/
+ (void)deleteWithUrl:(NSString *)url
params:(NSDictionary *)params
success:(requestSuccessBlock)successHandler
failure:(requestFailureBlock)failureHandler;/**
* 下载文件,监听下载进度
*/
+ (void)download:(NSString *)url
successAndProgress:(progressBlock)progressHandler
complete:(responseBlock)completionHandler;/**
* 文件上传
*/
+ (void)upload:(NSString *)url
params:(NSDictionary *)params fileConfig:(SMKHttpFileConfig *)fileConfig
success:(requestSuccessBlock)successHandler
failure:(requestFailureBlock)failureHandler;/**
* 文件上传,监听上传进度
*/
+ (void)upload:(NSString *)url
params:(NSDictionary *)params
fileConfig:(SMKHttpFileConfig *)fileConfig
successAndProgress:(progressBlock)progressHandler
complete:(responseBlock)completionHandler;@end
```