使用Objective C / iPhone在社交网络上发布
使用Objective C / iPhone在社交网络中发布
Objective C / iPhone : API文档
使用Objective C / iPhone在社交网络上发布
NSString *aclass = @"social";
NSString *method = @"send";
NSString *user = @"user";
NSString *password = @"password";
NSString *to = @"123456";
NSString *message = @"message+test";
NSString *scheduledatetime = @"";
NSString *url = @"";
NSString *picture = @"";
NSString *targetUrl = [NSString stringWithFormat:@"https://www.afilnet.com/api/http/?class=%@&method=%@&user=%@&password=%@&to=%@&message=%@&scheduledatetime=%@&url=%@&picture=%@", aclass, method, user, password, to, message, scheduledatetime, url, picture]
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setHTTPMethod:@"GET"];
[request setURL:[NSURL URLWithString:targetUrl]];
[[[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:
^(NSData * _Nullable data,NSURLResponse * _Nullable response,NSError * _Nullable error) {
NSString *myString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSLog(@"Data received: %@", myString);
}] resume];
发出请求时,您将收到以下字段:
下面列出了可能的错误代码
参数:
请求: