获取数据

+(void)getDatawith:(NSString *)url complement:(void (^)(id))block

{

    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];

    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json",@"text/json", @"text/javascript",@"text/html",@"text/plain",nil];

    [manager GET:url parameters:nil progress:^(NSProgress * _Nonnull downloadProgress) {



    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {


        block(responseObject);


    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {



    }];

}

你可能感兴趣的:(获取数据)