任务<E94BEE4D-E88B-4827-BE0A-E5CF1FE35F5C><0> HTTP加载失败,0/0字节错误代码:-1200 [3:-9858]

问题描述

我正在应用程序中使用上载图像的功能。应用程序使用SOAP请求将图像发送到服务器。最近,我将网址从http设置为https,并且遇到了这个问题,

任务。 HTTP加载失败,0/0字节(错误代码:-1200 [3:-9858])

NSURLConnection完成错误-代码-1200

我已经尝试了info.plist中的所有更改,但无法正常工作。请你帮助我好吗? 谢谢

解决方法

好,看看这个...

if ([challenge.protectionSpace.authenticationMethod  
isEqualToString:NSURLAuthenticationMethodServerTrust])      
[challenge.sender useCredential:[NSURLCredential    
credentialForTrust:challenge.protectionSpace.serverTrust] 
forAuthenticationChallenge:challenge];

[challenge.sender   
continueWithoutCredentialForAuthenticationChallenge:challenge];

认为应该是

if ([challenge.protectionSpace.authenticationMethod  
isEqualToString:NSURLAuthenticationMethodServerTrust])      
[challenge.sender useCredential:[NSURLCredential    
credentialForTrust:challenge.protectionSpace.serverTrust] 
forAuthenticationChallenge:challenge];
else // you need to add an else here
[challenge.sender   
continueWithoutCredentialForAuthenticationChallenge:challenge];

编辑

此外,我看到您将网址指定为

https://pro-ap.com.au/Mobile/profilepic.asmx?

删除最后一个问号,因为它是请求的一部分,并将在构建请求时自动添加。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...