我正在尝试通过重新创建成功的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) 我正在尝试执行 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,一切都会正常工作:
我只能假设像“?”这样的项目 而“&”会破坏这个过程。关于如何实现这一点的任何想法?
谢谢大家的帮助。
我正在尝试使用 REreplace 从字符串中删除重音符号,但它不起作用。
\n这是字符串:
\nAlertas del Condado: Por favor, h\xc3\xa1ganos saber si usted recibe este mensaje. Gracias.\nRun Code Online (Sandbox Code Playgroud)\n尝试删除“h\xc3\xa1ganos”中的重音符号并将其替换为“a”。
\n这是代码:
\nRereplace(trans_sms, '\xc3\xa1', 'a', 'all')\nRun Code Online (Sandbox Code Playgroud)\ntrans_sms绳子在哪里。
我一直在尝试搜索,但无法弄清楚为什么它没有被替换。
\n预先感谢任何人的帮助!
\n