我正在尝试使用 ASIHTTPRequest put 方法将文件从 Document 文件夹上传到 URL。我收到以下错误,似乎是 kCFErrorHTTPParseFailure error 。任何想法是什么问题以及如何解决?
Error Domain=ASIHTTPRequestErrorDomain Code=1 "A connection failure occurred"
UserInfo=0xe027890 {NSUnderlyingError=0xe026300 "The operation couldn’t be completed.
(kCFErrorDomainCFNetwork error 303.)", NSLocalizedDescription=A connection failure
occurred}
My code as follow
NSURL *url = [NSURL URLWithString:@"http://www.uploadURL/"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setRequestMethod:@"PUT"];
[request addBasicAuthenticationHeaderWithUsername:@"UsrName"
andPassword:@"UserPassword"];
[request setValidatesSecureCertificate:NO];
[request setDelegate:self];
request.shouldAttemptPersistentConnection = NO;
[request setPostBodyFilePath:fullPathFile];
[request setShouldStreamPostDataFromDisk:YES];
[request startAsynchronous];
我只是在尝试为什么我会收到该错误以及正确执行此操作的方法。
谢谢