Latest 0.0.7
Homepage https://github.com/ZLPublicLibrary/ZLHTTPSessionManager
License MIT
Platforms ios 8.0
Frameworks UIKit, Foundation
Authors

简介

基于AFNetworking的马甲库


作用

- 日志打印
- 筛除NULL
- 检测网络状态
- 将ERROR进行分类    
- 转换基本数据类型为字符串

安装

pod 'ZLHTTPSessionManager', '~> 0.0.7'

使用

  • 头文件
    #import <ZLHTTPSessionManager.h>
  • AppDelegate配置
    //配置基本信息
    [ZLHTTPSessionManager configDebugUrlPrefix:@"调试环境前缀" OnlineUrlPrefix:@"发布环境前缀" Online:NO ShowLogs:YES NetworkState:^(ZLHTTPSessionNetworkStatus state) {
       //网络状态改变后的回调
    }];
  • GET

    //参数
    NSMutableDictionary *dictM = [NSMutableDictionary new];
    dictM[@"key"] = @"value";
    
    [ZLHTTPSessionManager GET:@"路径" Params:dictM AddHttpHeader:NO CachePolicy:YES Results:^(ZLHttpErrorState sessionErrorState, id responseObject) {
        ///处理结果
    }];
  • POST

    //参数
    NSMutableDictionary *dictM = [NSMutableDictionary new];
    dictM[@"key"] = @"value";
    
    [ZLHTTPSessionManager POST:@"路径" Params:dictM ModelArray:nil AddHttpHeader:NO CachePolicy:YES Results:^(ZLHttpErrorState sessionErrorState, id responseObject) {
        ///处理结果
    }];

重大迭代跟踪

~> 0.0.7 追加头文件
~> 0.0.6 使用子组件控制文件结构
~> 0.0.1 基本功能已完善


FAQ

  • 搜索不到?
    • 终端执行
      rm ~/Library/Caches/CocoaPods/search_index.json
    • 重新pod search ZLHTTPSessionManager
  • 安装失败?
    • 查看你的当前项目的podfile里是否已经安装了AFNetworking,如果有,请将它删除,然后重试。

Latest podspec

{
    "name": "ZLHTTPSessionManager",
    "version": "0.0.7",
    "summary": "u57fau4e8eAFNetworkingu7684u9a6cu7532u5e93",
    "description": "u5bf9AFNetworkingu7684u8bf7u6c42u8fdbu884cu4e86u4e00u5c42u5c01u88c5uff0cu96c6u6210u4e86u6253u5370u65e5u5fd7u3001u68c0u6d4bu7f51u7edcu72b6u6001u3001u7b5bu9664NULLu3001u8f6cu6362u57fau672cu6570u636eu7c7bu578bu4e3au5b57u7b26u4e32u3001u5c06ERRORu8fdbu884cu5206u7c7bu7b49u3002",
    "homepage": "https://github.com/ZLPublicLibrary/ZLHTTPSessionManager",
    "license": "MIT",
    "authors": {
        "Mr.Zhao": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/ZLPublicLibrary/ZLHTTPSessionManager.git",
        "tag": "0.0.7"
    },
    "public_header_files": "ZLHTTPSessionManager/Classes/ZLHTTPSessionHeader.h",
    "source_files": "ZLHTTPSessionManager/Classes/ZLHTTPSessionHeader.h",
    "frameworks": [
        "UIKit",
        "Foundation"
    ],
    "subspecs": [
        {
            "name": "Model",
            "source_files": "ZLHTTPSessionManager/Classes/Model/*.{h,m}"
        },
        {
            "name": "ReplaceNull",
            "source_files": "ZLHTTPSessionManager/Classes/ReplaceNull/*.{h,m}"
        },
        {
            "name": "Request",
            "source_files": "ZLHTTPSessionManager/Classes/Request/**/*.{h,m}",
            "dependencies": {
                "AFNetworking": [
                    "~> 3.2.1"
                ],
                "ZLHTTPSessionManager/Model": [],
                "ZLHTTPSessionManager/ReplaceNull": []
            }
        }
    ]
}

Pin It on Pinterest

Share This