小编Sco*_*ott的帖子

尝试将JSON HTTP帖子转换为CFHTTP帖子

我正在尝试通过重新创建成功的Firebase控制台帖子的输出来通过CFHTTP正确编码对Firebase Cloud Messaging REST API的调用。以下是控制台指出的正确代码

POST /fcm/send HTTP/1.1
Host: fcm.googleapis.com
Content-Type: application/json
Authorization: key=AIzcXE
cache-control: no-cache

{   
  "to": "e5kpn8h9bR95NuXVHTOi50bCURG0BS4S6ccUm3X5q",
  "priority": "high",
  "notification" : {
    "title": "",
    "body" : "This is the actual message content",
    "sound": "default", 
    "image": "https://gladevalleyanimalhospital.net/wp-content/uploads/2017/03/raster-7.png"
  }
} 
Run Code Online (Sandbox Code Playgroud)

这是我们当前的CFHTTP代码:

<cfhttp method="Post" url="https://fcm.googleapis.com/fcm/send"> 
   <cfhttpparam type="header" name="Authorization" value="key=AIzXE">
   <cfhttpparam type="header" name="Content-Type" value="application/json">
   <cfhttpparam type="header" name="Postman-Token" value="e19b8abf3f9">
   <cfhttpparam type="header" name="cache-control" value="no-cache">

   <cfhttpparam type="Formfield" value="3569D24982E3B" name="to"> 
   <cfhttpparam type="Formfield" value="high" name="priority"> 
   <cfhttpparam type="Formfield" value="Test" name="title">
   <cfhttpparam type="Formfield" value="This is the actual message content" …
Run Code Online (Sandbox Code Playgroud)

coldfusion cfhttp firebase cfml firebase-cloud-messaging

1
推荐指数
1
解决办法
87
查看次数

Coldfusion cfhttp - 有一个破坏 get 函数的 URL var

我正在尝试执行 cfhttp 帖子,我需要在 URL 变量中包含一个 URL,以指示存放交货收据的位置。

这是我的代码:

    <cfhttp result="CFHTTP" method="GET" url="http://xxxxxxxxxxx/send-sms.php?sender=#numbers.number#&to=#get_sms.receiver#&message=#get_sms.msgdata#&dlr-url=#get_sms.dlr_url#">
    <cfhttpparam type="formfield" name="sender" value="#numbers.number#">
    <cfhttpparam type="formfield" name="to" value="#get_sms.receiver#">
    <cfhttpparam type="formfield" name="message" value="#get_sms.msgdata#">
    <cfhttpparam type="formfield" name="dlr-url" value="#get_sms.dlr_url#">
</cfhttp> 
Run Code Online (Sandbox Code Playgroud)

如果我不包含类似于以下内容的 dlr_url,一切都会正常工作:

http://entry.xxxxxxxx.com/process_dlr.cfm?status=%d&msisdn=%p&dlr-mask=31&data=%a&batchid=161F3CE3-E031-9CFF-7364A9C1AC50AA5B&destination=2&accountID=16182&329

我只能假设像“?”这样的项目 而“&”会破坏这个过程。关于如何实现这一点的任何想法?

谢谢大家的帮助。

url coldfusion cfhttp

1
推荐指数
1
解决办法
88
查看次数

尝试在 Coldfusion 中替换重音

我正在尝试使用 REreplace 从字符串中删除重音符号,但它不起作用。

\n

这是字符串:

\n
Alertas del Condado: Por favor, h\xc3\xa1ganos saber si usted recibe este mensaje. Gracias.\n
Run Code Online (Sandbox Code Playgroud)\n

尝试删除“h\xc3\xa1ganos”中的重音符号并将其替换为“a”。

\n

这是代码:

\n
Rereplace(trans_sms, '\xc3\xa1', 'a', 'all')\n
Run Code Online (Sandbox Code Playgroud)\n

trans_sms绳子在哪里。

\n

我一直在尝试搜索,但无法弄清楚为什么它没有被替换。

\n

预先感谢任何人的帮助!

\n

coldfusion cfml

1
推荐指数
1
解决办法
209
查看次数