0
我试图使用Bufferapp API为社交网络自动创建一些缓冲区,并让它们在自动时间发布。使用API URL向Web服务发送图像
我需要使用他们的API,特别是this method,通过图像和文本发送我的帖子。我已经算出了几乎所有的东西,但我想不出用这个API发送图像的正确方法。
我google了一下,但我似乎无法找到办法做到这一点。我看到的所有示例都是通过POST发送整个图像的,但它们似乎没有使用API格式。
换句话说,我怎么能做到这样?
https://webservice.com/api/send_post?access_token=123&text=huehuehue&image=__
编辑:我还没有附加任何的源代码,因为我不知道如何解决NSImage中的“转换”的东西,可以用来和送过来使用API URL,但这里是代码我试图产生:
NSOperationQueue *queue = [[NSOperationQueue alloc] init];
[queue addOperationWithBlock:^{
NSURL *create = [NSURL URLWithString:[NSString stringWithFormat:@"https://api.bufferapp.com/1/updates/create.json?access_token=%@", kToken, nil]];
NSString *text = @"text=%23Anime"; //Encoding so this is #Anime
NSString *now = @"now=0";
//Somehow add an NSImage to the http body.
}];