网络相关的问题

2017-01-12  本文已影响9人  翻滚的炒勺2013

获取response的状态码

 [[CTHTTPManager sharedManager].manager GET:url parameters:parameters progress:^(NSProgress * _Nonnull downloadProgress) {
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSHTTPURLResponse *response = (NSHTTPURLResponse *)task.response;
        NSLog(@"statusCode:%ld",(long)response.statusCode);
        finishedBlock(response,nil);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        finishedBlock(nil,error);
    }];
上一篇 下一篇

猜你喜欢

热点阅读