获取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);
}];
网友评论