大家好,又见面了,我是全栈君。
by 伍雪颖
NSHTTPURLResponse *response = nil;
NSError *error = nil;
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url]];
request.timeoutInterval = 15;
request.HTTPMethod = @"POST";
NSData *respData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
if (error) {
NSLog(@"error");
[ZAActivityBar showErrorWithStatus:@"Network unavailabel! Please try again!"];
}
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/116167.html原文链接:https://javaforall.cn