0
嗨,我是AFNetworking庫的新手,並將其首次集成到我的iPAD應用程序中。但是我很難找到一個可供參考的工作示例。要了解AFNetworking ios庫AFXMLRequestOperation
我在這裏找到了rckoenes的以下解決方案AFNetworking POST and get Data back。但是我很難實施它。由於該答案已被標記爲正確。我假設圖書館自那時以來發生了變化,這個例子可能不相關。
高度讚賞任何有關工作示例參考的幫助。
NSURLRequest *request = [wsu generateURLRequest:getFavAPI method : @"GET" arguments:nil eventName:USER_FAVS_SUCCESS_NOTIF contentType:nil];
NSLog(@"Request %@", request.description);
AFXMLRequestOperation *favOpertion = [[AFXMLRequestOperation alloc] initWithRequest:request];
//favOpertion.responseXMLParser = [NSXMLParser initialize]; // error: setting the readOnly property.
[favOpertion setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *favOpertion, id responseObject) {
NSLog(@"Response: %@",[favOpertion responseString]); // Never reached here
} failure:^(AFHTTPRequestOperation *favOpertion, NSError *error) {
NSLog(@"Error: %@",[favOpertion error]); // never reached here
}];
代碼打印請求內容描述爲有效的:HTTP:// [服務器名] /收藏夾/文件夾/用戶/ [UID]>