IOS Dictionary转换json,并提交json数据,中文无乱码

引入JSONKit.h
 NSMutableDictionary  d = [[NSMutableDictionary alloc] init]; 

  [dsetObject:@""forKey:@"School"];
            [dsetObject:@""forKey:@"QQ"];
            [dsetObject:@""forKey:@"Email"];
            NSData *postData = [[d JSONString] dataUsingEncoding:NSUTF8StringEncoding];
            NSString *str = [NSStringstringWithFormat:@"%@%@", kHost, kRegister];
            NSURL *url = [NSURLURLWithString:str];
            ASIFormDataRequest *request = [ASIFormDataRequestrequestWithURL:url];
            //            request setRequestHeaders:<#(NSMutableDictionary *)#>
            [request appendPostData:postData];
            request.shouldAttemptPersistentConnection = NO;
            request.timeOutSeconds = kTimeOutSecs;
            [request setDelegate:self];

            [request startAsynchronous];

猜你喜欢

转载自jimmy-miao.iteye.com/blog/1882437