Latest 1.1
Homepage https://github.com/josipbernat/JBMessage
License MIT
Platforms ios 6.0, requires ARC
Dependencies AFNetworking
Authors

JBMessage is simple iOS networking wrapper based on AFNetworking. It allows you to simplify your networking code and forces you to rearrange each API call into separate class.

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like JBMessage in your projects.

Podfile

platform :ios, '6.0'
pod 'JBMessage', '~> 1.0'

USAGE

GET Request

    JBMessage *message = [JBMessage messageWithURL:[NSURL URLWithString:@"http://example.com/resources.json"]
                                        parameters:@{@"foo": @"bar"}
                                     responseBlock:^(id responseObject, NSError *error) {
                                         NSLog(@"%@", responseObject);
                                     }];
    message.httpMethod = JBHTTPMethodGET;
    [message send];

POST Request

    JBMessage *message = [JBMessage messageWithURL:[NSURL URLWithString:@"http://example.com/resources.json"]
                                        parameters:@{@"foo": @"bar"}
                                     responseBlock:^(id responseObject, NSError *error) {
                                         NSLog(@"%@", responseObject);
                                     }];
    message.httpMethod = JBHTTPMethodPOST;
    [message send];

PUT Request

    JBMessage *message = [JBMessage messageWithURL:[NSURL URLWithString:@"http://example.com/resources.json"]
                                        parameters:@{@"foo": @"bar"}
                                     responseBlock:^(id responseObject, NSError *error) {
                                         NSLog(@"%@", responseObject);
                                     }];
    message.httpMethod = JBHTTPMethodPUT;
    [message send];

DELETE Request

    JBMessage *message = [JBMessage messageWithURL:[NSURL URLWithString:@"http://example.com/resources.json"]
                                        parameters:@{@"foo": @"bar"}
                                     responseBlock:^(id responseObject, NSError *error) {
                                         NSLog(@"%@", responseObject);
                                     }];
    message.httpMethod = JBHTTPMethodDELETE;
    [message send];

Latest podspec

{
    "name": "JBMessage",
    "version": "1.1",
    "summary": "JBMessage is simple iOS networking wrapper based on AFNetworking",
    "homepage": "https://github.com/josipbernat/JBMessage",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Josip Bernat": "[email protected]"
    },
    "social_media_url": "http://twitter.com/josipbernat",
    "platforms": {
        "ios": "6.0"
    },
    "source": {
        "git": "https://github.com/josipbernat/JBMessage.git",
        "tag": "v1.1"
    },
    "source_files": "JBMessage/JBMessage/**/*.{h,m}",
    "requires_arc": true,
    "dependencies": {
        "AFNetworking": [
            "~> 2.5"
        ]
    }
}

Pin It on Pinterest

Share This