英语----时态---过去式和过去完成时

- (void)viewDidLoad {

    [super viewDidLoad];

    // 如果要设置请求体

    NSURLSession *session  = [NSURLSession sharedSession];

    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@""]];

    request.HTTPMethod = @"POST";

    request.HTTPBody = [@"" dataUsingEncoding:NSUTF8StringEncoding];

    NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {

    }];

    [task resume];

}

 

-(void)get2{

    // 直接用url就行

    NSURLSession *session  = [NSURLSession sharedSession];

    NSURLSessionDataTask *task = [session dataTaskWithURL:[NSURL URLWithString:@""] completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {

    }];

    // 启动

    [task resume];

}

 -(void)get1{

    NSURLSession *session  = [NSURLSession sharedSession];

    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@""]];

    NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {

    }];

    // 启动

    [task resume];

}

posted on 2017-06-15 23:37  1018475062  阅读(240)  评论(0编辑  收藏  举报