iOS技巧-Xcode7下AFNetworking请求发生404错误(非服务器问题)

1.问题描述

function:__58-[ALHomePageViewController testRequestAppListWithOriginal]_block_invoke_2 line:214 content: { URL: http://services.ubtrobot.com:8081/opencenter/app/accessGetListByPage }, response:  { URL: http://services.ubtrobot.com:8081/opencenter/app/accessGetListByPage } { status code: 404, headers {
    "Content-Length" = 0;
    Date = "Wed, 21 Oct 2015 21:19:08 GMT";
    Server = "Apache-Coyote/1.1";
    "Set-Cookie" = "JSESSIONID=A8A4C8BA39D8BE680D1A4E58C567754F; Path=/opencenter/; HttpOnly";
} }>

2.网络请求在第三方Paw连接正常

iOS技巧-Xcode7下AFNetworking请求发生404错误(非服务器问题)_第1张图片
网络请求正常.jpg

3.解决办法

方式一:在info.list的源码中添加(对本项目无效)

    NSAppTransportSecurity
    
        NSAllowsArbitraryLoads
        
    

方式二:在info.list的源码中添加(实测对本项目有效)

    NSAppTransportSecurity
    
        NSAllowsArbitraryLoads
        
        NSExceptionDomains
        
            NSIncludesSubdomains
            
            NSTemporaryExceptionAllowsInsecureHTTPLoads
            
            NSTemporaryExceptionMinimumTLSVersion
            TLSv1.1
        
    

你可能感兴趣的:(iOS技巧-Xcode7下AFNetworking请求发生404错误(非服务器问题))