如何授权从 google-documents list-api 获取的内容下载 PDF 文档
我有通过使用以下代码授权自己获得的谷歌文档列表:
<cfhttp url="https://www.google.com/accounts/ClientLogin" method="post" result="result" charset="utf-8">
<cfhttpparam type="formfield" name="accountType" value="HOSTED_OR_GOOGLE">
<cfhttpparam type="formfield" name="Email" value="[email protected]">
<cfhttpparam type="formfield" name="Passwd" value="xyz">
<cfhttpparam type="formfield" name="service" value="writely">
<cfhttpparam type="formfield" name="source" value="abc-xyz-2010">
</cfhttp>
现在我可以借助 content.xmlAttribute 从包含所有文档的 xml 文件中下载 Word 文档和 PPT。 但我无法下载 PDF 文件。我收到的错误消息是“授权需要错误 401”。我检查了文档,它说: 也无法手动构建这些类型文件的下载 URL。相反,将经过身份验证的 HTTP GET 发送到条目的 src 链接:
<content type="text/html" src="https://doc-04-20-docs.googleusercontent.com/docs/secure/m7an0emtau/WJm.../YzI2Y2ExYWVm?h=16655626&e=download&gd=true"/>
有人可以告诉我如何传递授权信息并使 PDF 下载链接正常工作吗? 预先非常感谢!
I have list of google docs which i got by authorizing myself with below code:
<cfhttp url="https://www.google.com/accounts/ClientLogin" method="post" result="result" charset="utf-8">
<cfhttpparam type="formfield" name="accountType" value="HOSTED_OR_GOOGLE">
<cfhttpparam type="formfield" name="Email" value="[email protected]">
<cfhttpparam type="formfield" name="Passwd" value="xyz">
<cfhttpparam type="formfield" name="service" value="writely">
<cfhttpparam type="formfield" name="source" value="abc-xyz-2010">
</cfhttp>
Now I am able to download word documents and PPT by the help of content.xmlAttribute from the xml file having all documents.
But I am not able to download PDF files. Error message I am getting is "Authorization require error 401".I checked documentation it say that:
It is also not possible to manually contruct the download URL for these types of files. Instead, send an authenticated HTTP GET to the entry's src link:
<content type="text/html" src="https://doc-04-20-docs.googleusercontent.com/docs/secure/m7an0emtau/WJm.../YzI2Y2ExYWVm?h=16655626&e=download&gd=true"/>
Can someone please tell me how to pass authorization information and get the PDF download link working.
Thanks a lot in advance!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将 method="post" 替换为 method="get" 吗?
Replace method="post" with method="get" ?