【发布时间】:2026-01-14 14:10:01
【问题描述】:
我已经编写了一些代码来与 YouTube API 进行交互,在开发时它运行良好 - 在接受时却不行!
我发现 serializeJSON 的输出正在添加 //
<cfset jsonUpdateVideo={
"id"= "#arguments.videoId#",
"snippet"= {
"title"= "#arguments.title#",
"description"= "#arguments.description#",
"tags"= [#trim(lstTags)#],
"categoryId"= "28"
},
"status"= {
"privacyStatus"= "#arguments.privacy#",
"embeddable"= True,
"license"= "youtube"
}
}>
结果
serializeJSON(jsonUpdateVideo)
是
//{"status":{"embeddable":true,"privacyStatus":"Private","license":"youtube"},"snippet":{"description":"More information about this video can be found at some URL","categoryId":28,"title":"Video Test","tags":["\"tag1\", \"tag2\", \"tag3\", \"tag4\", \"tag4\", \"tag5\""]},"id":"_jI4GfjnGCM"}
如果我将其粘贴到 YouTube API Explorer 中而没有 // 它可以正常工作并更新视频详细信息。
不确定 // 来自哪里,因为它在开发中是可以的。
【问题讨论】:
-
通过将其称为“评论”而不是“//”,我找到了一个可能的解决方案 - *.com/questions/17146365/…
标签: json coldfusion youtube-api