【问题标题】:Google Chart Image does not load谷歌图表图像不加载
【发布时间】:2013-10-23 14:19:43
【问题描述】:

我正在使用 Google 图表创建二维码。当我直接将链接粘贴到浏览器上时,它会完美地生成二维码。但是,我无法将其作为图像加载。我收到 400 错误响应。

i.e.: http://www.google.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth://totp/Test%3Fsecret%3DGVFXGN3WIYZEMYKW 

直接粘贴在浏览器中可以,但我怎样才能让它显示为图像?

我做错了什么?

<img src="http://www.google.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth://totp/AEB+Staff+Benefits%3Fsecret%3DGVFXGN3WIYZEMYKW" width="200" height="200" />

【问题讨论】:

标签: google-visualization qr-code


【解决方案1】:

您需要对 URL 的 chl 参数中的 /(代码 %2F)进行 URL 编码:

http://www.google.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth:%2F%2Ftotp%2FTest%3Fsecret%3DGVFXGN3WIYZEMYKW

【讨论】:

  • 是的。做过某事。并且必须进行 curl 提取,然后对其进行 base64 编码以显示为图像。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-09-09
  • 1970-01-01
  • 1970-01-01
  • 2012-04-16
相关资源
最近更新 更多