美文网首页
获取网页状态码

获取网页状态码

作者: 天码行空 | 来源:发表于2018-01-03 16:57 被阅读0次

    - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

    {

        NSHTTPURLResponse *response = nil;

        [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:nil];

        NSLog(@"网页状态码 = %zd",response.statusCode);

        if (response.statusCode == 404) {

        }

        return YES;

    }

    相关文章

      网友评论

          本文标题:获取网页状态码

          本文链接:https://www.haomeiwen.com/subject/fkxknxtx.html