JHRequestDebugView
请求调试窗口
文件
JSONFormat.html // JSON格式化
JHRequestDebugView.h // 调试窗口
JHRequestDebugView.m
JHRequestHistoryView.h // 历史记录
JHRequestHistoryView.m
UIWindow+JHRequestDebugViewShake.h // 摇一摇
UIWindow+JHRequestDebugViewShake.m
版本
最新版本:1.2.4
日志
- 2.添加新方法(add method).(2018-9-29) -> 版本:1.2.0
- 1.添加历史记录(add history).(2018-9-28) -> 版本:1.1.0
- 0.upload.
示例
---------------------- 版本 1.2.0 ---------------------------
GET 请求
NSURLSessionDataTask *task = [manager GET:url parameters:dic progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
// other code
#if DEBUG
// save for debug.
[[JHRequestDebugView defaultDebugView] jh_store_history:url parameter:dic response:responseObject];
#endif
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
// other code
}];
[[JHRequestDebugView defaultDebugView] jh_set_GET_task:task parameter:dic];
---------------------- 版本 1.0.0 ---------------------------
如果需要(在版本 1.0.0 中),应在 HTTPHeaderField 中设置 token 或 cookie。
GET 请求
[manager GET:url parameters:dic progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
// other code
#if DEBUG
// save for debug.
[[JHRequestDebugView defaultDebugView] jh_store_history:URL parameter:dic response:responseObject];
#endif
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
// other code
}];
[[JHRequestDebugView defaultDebugView] jh_set_GET_URL:url parameter:dic];