where参数设置
if([keyisEqualToString:@"where"]) {
NSError*error;
NSData*jsonData = [NSJSONSerializationdataWithJSONObject:par[key]options:0error:&error];
NSString*jsonString = [[NSStringalloc]initWithData:jsonDataencoding:NSUTF8StringEncoding];
NSString* hString = [jsonString stringByAddingPercentEncodingWithAllowedCharacters: [NSCharacterSet URLUserAllowedCharacterSet]];
searchStr = [NSStringstringWithFormat:@"%@=%@",key,hString];
其他参数拼接
else {
if(searchStr.length==0) {
searchStr = [NSStringstringWithFormat:@"%@=%@",key,par[key]];
}else{
searchStr = [NSStringstringWithFormat:@"%@&%@=%@",searchStr,key,par[key]];
}
}
网友评论