gpt4 book ai didi

ios - 在 <= iOS 8 中是可以的。但是 iOS 9,我得到错误

转载 作者:塔克拉玛干 更新时间:2023-11-02 10:00:24 26 4
gpt4 key购买 nike

我收到错误:

Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSErrorFailingURLStringKey=, NSErrorFailingURLKey=, NSLocalizedDescription=unsupported URL, NSUnderlyingError=0x15d275b0 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "unsupported URL" UserInfo={NSErrorFailingURLKey=, NSErrorFailingURLStringKey=, NSLocalizedDescription=unsupported URL}}}

我的代码:

AFHTTPClient *httpClient = [AFHTTPClient clientWithBaseURL:[NSURL URLWithString:strUrl]];
[httpClient setParameterEncoding:AFFormURLParameterEncoding];
NSMutableURLRequest *request = [httpClient requestWithMethod:@"POST" path:nil parameters:info];
[request setTimeoutInterval:TIMEOUT_INTERVAL];

AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc]initWithRequest:request];
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {

[self.delegate requestSuccess:[NSNumber numberWithInt:REQUEST_TYPE_LOGIN] result:[operation responseString]];


} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
[self.delegate requesFailed:[NSNumber numberWithInt:REQUEST_TYPE_LOGIN] result:[operation responseString]];
}

有什么想法可以帮助我吗?

最佳答案

在 iOS 9 中默认只允许 https。您可以通过向 Info.plist 添加 key 来选择退出: https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/

关于ios - 在 <= iOS 8 中是可以的。但是 iOS 9,我得到错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31558254/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com