问题描述
我正在尝试通过使用咖啡脚本的API补丁调用来更新我的票务系统。
我有一个变量集,即ID,我想在URL的末尾包含它,以便我的补丁调用更新该ID,但由于某种原因,该变量无法按预期工作
我希望打来电话
https://www.examplesite.com/api/now/v1/table/incident/123456789
我看到的是
https://www.examplesite.com/api/now/v1/table/incident/
data3 = 123456789
res.http("https://www.examplesite.com/api/now/v1/table/incident/#{data3}")
.headers(Authorization: "Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxx=",Accept: 'application/json','Content-Type': "application/json")
.patch(data) (err,httpres,body) ->
out = JSON.parse(body)
if err
res.send "Error!"
return
if httpres.statusCode isnt 201
res.send "Unable to retrieve ticket,ERROR!"
console.log out
return
else
res.send "Ticket #{out.result.sys_id}"
console.log out.result.sys_id
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)