# jsonhttp **Repository Path**: knight2015/jsonhttp ## Basic Information - **Project Name**: jsonhttp - **Description**: 用惯了xml 再试试json 直接单元测试 效果很可取 - **Primary Language**: Objective-C - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2014-11-15 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ``` /************************************************************ * * CWSwift CONFIDENTIAL * __________________ * Copyright (C) 2013-2014 CWSwift Technologies. All rights reserved. * * NOTICE: All information contained herein is, and remains * the property of CWSwift Technologies. * Dissemination of this information or reproduction of this material * is strictly forbidden unless prior written permission is obtained * from CWSwift Technologies. * knight lu 349919133 * 创新源于一种感觉 knight lu */ ``` ##不错的框架 直接可以在test中运行 *** >请看 ``` - (void)testPost { NSDictionary* parameters = @{@"name" : @"Mark", @"nick" : @"thefosk"}; UNIHTTPJsonResponse* response = [[UNIRest post:^(UNISimpleRequest * request) { [request setUrl:@"http://httpbin.org/post"]; [request setParameters:parameters]; }] asJson]; NSDictionary* args = [response.body.object valueForKey:@"form"]; NSAssert(200 == response.code, @"Invalid code %d", response.code); NSAssert(2 == [args count], @"Invalid arguments size"); NSAssert([@"Mark" isEqualToString:[args valueForKey:@"name"]], @"Invalid argument value"); NSAssert([@"thefosk" isEqualToString:[args valueForKey:@"nick"]], @"Invalid argument value"); } ```