【问题标题】:Pushover Base64 Image AttachmentPushover Base64 图像附件
【发布时间】:2021-03-22 20:09:08
【问题描述】:

我似乎不知道如何在https://api.pushover.net/1/messages.json POST API 中使用 base64 图像字符串。

到目前为止,我的请求正文中有token={APPTOKEN}&user={userID}&message=here+is+an+image+attachment&attachment=data:image/jpeg;base64,{base64imagevalue},请求标头中有Content-Type: application/x-www-form-urlencoded。但是当通知通过时,图像不可用。


我已转到此代码。但还是没用。

{
  "token": "xxxxxxx",
  "user": "xxxxx",
  "title": "xxxTEST",
  "message": "This is a test.",
  "priority": "2",
  "retry": "30",
  "expire": "300",
  "sound": "alien",
  "attachment": {
    "mime": "image/jpg",
    "data": "image/jpeg;base64,/9....QEB"
  }
}

当我检查结果时,它显示......

<img src="data:application/octet-stream;base64,eyJtaW1lIj....T0ifQ==">

并且图像显示损坏。

【问题讨论】:

    标签: pushover


    【解决方案1】:

    您是否尝试使用“Content-Type: application/json”发送?

    当我尝试使用 json 内容类型和一个小的 jpeg 数据时,它是成功的。 但是对于 110K 文件,它对我不起作用。我也在寻找解决方案。

    ps。我知道这不是一个正确的答案,但我无法“评论”。

    【讨论】:

      猜你喜欢
      • 2018-07-04
      • 1970-01-01
      • 1970-01-01
      • 2015-05-12
      • 1970-01-01
      • 1970-01-01
      • 2023-03-30
      • 2018-03-20
      • 1970-01-01
      相关资源
      最近更新 更多