是否可以在 Google 文档请求中包含 http 标头?
我正在开发一个 Adnroid 应用程序,需要读取远程 pdf 文件并打开它,我看到 google docs 可以使用以下网址从 pdf 进行转换:
http://docs.google.com/viewer?url=
我遇到的问题是,我检索文件的 url 需要将标头添加到 http要求。有谁知道如何将其添加到对谷歌文档的调用中?
I am working on an Adnroid app that needs to read a remote pdf file and open it, I saw that google docs can do the conversion from pdf, using this url:
http://docs.google.com/viewer?url=
The problem I have is that my url to retrieve the file requires a header to be added to the http request. Does anyone have a hint as to how this could be added to the call to google docs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我没有完全理解你的问题,但这是我在网络视图中加载pdf时所做的相同的事情: Android - 加载PDF/PDF查看器,它可能会帮助你。
根据您下面的评论,我可以建议您考虑一种情况:
给出错误消息
I didnt get your problem exactly what you means to say , but here is the same thing i have done to load pdf inside a webview: Android - Load PDF / PDF Viewer, it may help you.
From your comment below, i can suggest you to think one scenario:
Give error message
秘密是HttpClient。
查看此示例在 cookies 上 - 它与标头不同,但可以使用同一个对象来设置它们。这是一段非常好的代码。
谷歌一下,如果你有更多问题 - 一旦你知道该使用什么,我发现很容易查找我需要的具体信息。
The secret is HttpClient.
Check out this example on cookies - it's different from headers, but the same object can be used to set them both. It's a pretty good chunk of code.
Google around, if you've got more questions - once you know what to use, I found it easy to look up the specifics I needed.