| 测试已测试 | ✗ |
| Lang语言 | Obj-CObjective C |
| 许可证 | MIT |
| Released最新版本 | 2015年3月 |
由 Mattt,Kevin Harwood 维护。
| 依赖于 | |
| AFNetworking | ~> 2.4 |
| Ono | ~> 1.1 |
AFWebDAVManager 是一个用于与 WebDAV 交互的 AFHTTPRequestOperationManager 子类。
注意: 此代码仍处于早期开发阶段,因此在使用到生产代码时要小心。
AFWebDAVManager *webDAVManager = [[AFWebDAVManager alloc] initWithBaseURL:[NSURL URLWithString:@"http://example.com"]];
webDAVManager.credential = [NSURLCredential credentialWithUser:@"username"
password:@"Pa55word"
persistence:NSURLCredentialPersistenceForSession];
[webDAVManager createFileAtURLString:@"/path/to/file.txt"
withIntermediateDirectories:YES
contents:[@"Hello, World" dataUsingEncoding:NSUTF8StringEncoding]
completionHandler:^(NSURL *fileURL, NSError *error)
{
if (error) {
NSLog(@"[Error] %@", error);
} else {
NSLog(@"File created: %@", fileURL);
}
}];
[webDAVManager contentsOfDirectoryAtURLString:@"/path"
recursive:NO
completionHandler:^(NSArray *items, NSError *error)
{
if (error) {
NSLog(@"[Error] %@", error);
} else {
NSLog(@"Items: %@", items);
}
}];Mattt Thompson
AFWebDAVManager 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。