【问题标题】:Google Doc Api for iPhone AppiPhone 版 Google Doc Api 应用程序
【发布时间】:2011-08-18 07:19:12
【问题描述】:

我找到了许多实现 google API 的 iPhone 项目的链接,但没有一个处于运行状态有没有人知道任何可以从 google 文档成功下载或上传文件的教程的链接

【问题讨论】:

    标签: iphone ios


    【解决方案1】:

    您可以找到 Google Docs API over here

    该页面的前两个部分提供了有关如何使用 API 来同时处理 retrieveexport 文档的更多链接。

    您可以使用任意数量的第三方库(例如 ASIHttpRequestAFNetworking)通过 HTTP 访问 API,或使用 NSURLConnection 自行开发

    【讨论】:

    • NSString *authorizationHeader = [NSString stringWithFormat:@"GoogleLogin auth=\"%@\"" , [another objectAtIndex:1]]; NSURL *url2 = [NSURL URLWithString:@"docs.google.com/feeds/documents/private/full"]; NSMutableURLRequest *urlRequest2 = [[NSMutableURLRequest alloc]initWithURL:url2];
    • [urlRequest2 setHTTPMethod:@"POST"]; [urlRequest2 setValue:@"2.0" forHTTPHeaderField:@"GData-Version"]; [urlRequest2 setValue:authorizationHeader forHTTPHeaderField:@"Authorization"];[urlRequest2 setValue:Length forHTTPHeaderField:@"Content-Length"]; [urlRequest2 setValue:@"text/html" forHTTPHeaderField:@"Content-Type"]; [urlRequest2 setValue:slugStr forHTTPHeaderField:@"Slug"]; [urlRequest2 setHTTPBody:audioData];
    • 以上是我的 HTTP 请求的代码。我得到的响应是无效令牌 @micpringle
    • [another objectAtIndex:1] 包含什么?文档建议使用 OAuth 2.0 授权用户并获取授权令牌;你在做这个吗?
    • 这是 google 使用客户端登录返回的授权令牌。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-14
    相关资源
    最近更新 更多