ASIHTTPRequest中的MY代码是:
NSURL *url = [NSURL URLWithString:@"http://avicenna-apps.com/harleyeventget.php"];
ASIHTTPRequest *_Request = [ASIHTTPRequest requestWithURL:url];
__weak ASIHTTPRequest * Request=_Request;
[Request setCompletionBlock:^{
NSData *Data = [Request responseData];
];
[Request setFailedBlock:^{
NSError *error = [Request error];
NSlog(@"Error IS %@,error");
}];
[Request startAsynchronous];
如何在AFNetwork中写入?
答案 0 :(得分:0)
在AFHttpClient
内,
(void)getPath:(NSString *)path
parameters:(NSDictionary *)parameters
success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
这是AFNetworking的官方网站,click