且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

需要不使用Firebase API的Nest REST API的工作示例

更新时间:2022-02-04 15:34:38

两件事.首先,使用-L进行重定向.其次,直接放置到遥远的数据位置,例如

Two things. First, follow redirects with -L. Second, put directly to the away data location, like

curl -v -L -X PUT "https://developer-api.nest.com/structures/g-9y-2xkHpBh1MGkVaqXOGJiKOB9MkoW1hhYyQk2vAunCK8a731jbg/away?auth=<AUTH_TOKEN>" -H "Content-Type: application/json" -d '"away"'

PUT将覆盖某个位置的所有数据.上一条命令在逻辑上将结构的数据设置为{"away":"away"}.

The PUT overwrites all data at a location. The previous command would logically be setting the structure's data to just {"away":"away"}.