有人可以解释一下如何用 cocoa 读取(或至少下载为 XML 格式)吗? 我就这样试过了。这可能是完全错误的:)。
NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://larcus.tumblr.com/api/read"]];
[request setHTTPMethod:@"POST"];
[request addValue:@"8bit" forHTTPHeaderField:@"Content-Transfer-Encoding"];
[request addValue: [NSString stringWithFormat:@"multipart/form-data; boundary=%@",[NSString MIMEBoundary]] forHTTPHeaderField: @"Content-Type"];
[NSURLConnection connectionWithRequest:request delegate:self];
[request release];
在 connectionDidFinishLoading: 方法中,我无法解析数据。 预先感谢您!
最佳答案
您没有创建正确的 HTTP POST 请求。
看看my answer to this question了解如何正确执行此操作。
关于xml - 阅读 Tumblr 仪表板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6361019/