【发布时间】:2019-10-24 21:55:33
【问题描述】:
我修改了完美的卡通示例,但我想我无法理解 API URL 是如何从胶囊中构造的。我在 github 上上传了我的尝试:https://github.com/igotapochahontas/skynet
【问题讨论】:
标签: api url search sample bixby
我修改了完美的卡通示例,但我想我无法理解 API URL 是如何从胶囊中构造的。我在 github 上上传了我的尝试:https://github.com/igotapochahontas/skynet
【问题讨论】:
标签: api url search sample bixby
您需要在 URL 参数的选项中使用查询对象。示例代码:
var options = {
query: {
day: day
cam: cam
}
};
如果它们已设置或使用修改您的代码:
if (typeof(day)!= "undefined"){
options.query.day= day
}
Bixby Github 是一个很好的示例代码来源,具体来说,请查看https://github.com/bixbydevelopers/capsule-samples-collection 上的 http-api-calls 示例
另请参阅文档:https://bixbydevelopers.com/dev/docs/reference/JavaScriptAPI/http#http-options
【讨论】: