转换json解析数据
+(void)httpGet:(NSString *)UrlString Cyy:(NSDictionary *)paramneters relust:(HouBlock)relust
{
AFHTTPSessionManager *Manger=[AFHTTPSessionManager manager];
Manger.responseSerializer = [AFHTTPResponseSerializer serializer];
[Manger GET:UrlString parameters:paramneters progress:^(NSProgress * _Nonnull downloadProgress) {
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
id obj = [NSJSONSerialization JSONObjectWithData:responseObject options:0 error:NULL];
// NSDictionary *dict = obj[@"weatherinfo"];
relust(obj);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
}];
}
网友评论