Giter Site home page Giter Site logo

jhnetworkmodule's Introduction

JHNetworkModule

V1.3.0:添加AFNetwork 4.0.1的适配

网络请求组件,封装AFNetwork,YYModel 仅封装简单的方法,以后扩展

使用方法

普通请求
    [JHRequest requestWithConfig:^(JHNetworkConfig *requestConfig) {
        requestConfig.URLString = @"接口名称";
        requestConfig.modelClass = @"数据model";
        requestConfig.parameters = 参数;
        requestConfig.requestType = 请求类型;
    } success:^(id responseObject) {
        NSLog(@"%@",responseObject);
        
    } failure:^(NSError *error) {
        
    }];
    上传图片
        [JHRequest requestWithConfig:^(JHNetworkConfig *requestConfig) {
        requestConfig.URLString = @"接口名称";
        requestConfig.requestType = JHRequestType_Upload;
        [requestConfig addFormDataWithName:文件类型名称 fileName:文件名 mimeType:[requestConfig mimeTypeWithImageData:数据data] fileData:数据data];
    } success:^(id responseObject) {
        NSLog(@"%@",responseObject);
        
    } failure:^(NSError *error) {
        
    }];

安装

1.手动添加:

  • 1.将 JHNetworkModule 文件夹添加到工程目录中
  • 2.导入 JHRequest.h #import "JHNetworkModule.h"

2.CocoaPods:

  • 1.在 Podfile 中添加 pod 'JHNetworkModule'
  • 2.执行 pod install 或 pod update
  • 3.导入 JHRequest.h 或者 #import "JHNetworkModule.h"

许可证

JHNetworkModule 使用 MIT 许可证,详情见 LICENSE 文件

jhnetworkmodule's People

Contributors

zjinhu avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.