Coldfusion:时间戳的奇数输出:替换为 x
我认为我的时间戳需要位于字符串的末尾。但是当我把它移到那里时 - 我得到了 × 的奇怪输出变成了 x。有解决办法吗?在前面它工作得很好。
<cfset usem = "timestamp=#unixdatetimeNow.getTime()#&symbol=#pair#&side=#side#&type=#type#&quantity=#size#">
输出:
timestamp=1645552579468&symbol=SHIBUSDT&side=sell&type=market&quantity=9005
<cfset usem = "symbol=#pair#&side=#side#&type=#type#&quantity=#size#×tamp=#unixdatetimeNow.getTime()#">
输出带有 x :
symbol=SHIBUSDT&side=sell&type=market&quantity=9005×tamp=1645552579468
如何修复此 x 替换?在 cfset 和脚本中都执行此操作
I think my timestamp needs to be at the end of the string. But when I move it there - I get an odd output of the × turns into an x. Is there a fix for this? At the front it works fine.
<cfset usem = "timestamp=#unixdatetimeNow.getTime()#&symbol=#pair#&side=#side#&type=#type#&quantity=#size#">
Outputs :
timestamp=1645552579468&symbol=SHIBUSDT&side=sell&type=market&quantity=9005
<cfset usem = "symbol=#pair#&side=#side#&type=#type#&quantity=#size#×tamp=#unixdatetimeNow.getTime()#">
Outputs with the x :
symbol=SHIBUSDT&side=sell&type=market&quantity=9005×tamp=1645552579468
How do I fix this x replacement? Does it in both cfset and in script
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更新:2022-04-06
TLDR;底线是,无需执行任何操作。正如评论中提到的,以及您的其他线程ColdFusion:Binance API : 并没有读取所有发送的参数,参数名称仍然是
×tamp
,只是看起来xtamp
当显示在屏幕上时。这是因为子字符串 × 被视为 html实体
×
,它被渲染为符号x
。当
timestamp
是查询字符串中的第一个参数时,“time”前面没有&
。所以它不被视为 html 实体。请记住,这只是一个演示问题。当您输出变量时,子字符串&time仅呈现为
x
。变量的实际内容不会改变。所以在你的 cfhttp 调用中使用它没有任何反应:可能会显示在屏幕上正确显示,但会中断您的 cfhttp 调用,因为它将参数名称设置为文字字符串
×tamp
但 API 需要名为timestamp
的参数。Update: 2022-04-06
TLDR; Bottom line, nothing needs to be done. As mentioned in the comments, and your other thread ColdFusion : Binance API : Not all sent parameters were read, the parameter name is still
×tamp
, it just appears to bextamp
when displayed on screen.It's because the substring × is being treated as the html entity
×
, which gets rendered as the symbolx
.When
timestamp
is the first parameter in the query string, there's no&
preceding "time". So it's not treated as an html entity.Keep in mind this is just a presentation issue. The substring &time is only rendered as
x
when you output the variable. The actual contents of the variable don't change. So nothing happens its used in your cfhttp call:That might display correctly on screen, but will break your cfhttp call because it sets the parameter name to the literal string
×tamp
but the API is expecting a parameter namedtimestamp
.