本文介绍了使用git bash授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试与Nest恒温器一起使用,以便可以将其应用于由基于Arduino的项目运行的家庭自动化中.到目前为止,我完全没有完成任何事情.我将不胜感激输入或重定向到其他资源.

I've been trying to work with my Nest thermostat so I can work it into home automation run by my Arduino-based projects. So far, I've completely failed to get anything done. I would greatly appreciate input or redirection to other resources.

我在Nest开发人员下注册,并创建了具有读/写权限的客户端.

I signed up under the Nest developer and created a client with read/write permissions.

我正在OAuth步骤中,我想开始从恒温器中提取基本信息.我去了https://home.nest.com/login/oauth2?client_id=[clientID]&state=STATE,其中clientID是我的项目的clientID.我按原样离开了STATE.

I'm at the OAuth step where I want to start pulling basic information out of thermostat. I went to https://home.nest.com/login/oauth2?client_id=[clientID]&state=STATE where clientID is the clientID for my project. I left STATE as is.

我收到了我将称为99ITPUMP的PIN,然后将其放入 Git BASH 中,所以:
curl POST https://api.home.nest.com/oauth2/access_token?code=99ITPUMP&client_id=[clientID]&client_secret=[clientSecret]&grant_type=authorization_code

I received the PIN that I'll call 99ITPUMP and I put that into Git BASH like so:
curl POST https://api.home.nest.com/oauth2/access_token?code=99ITPUMP&client_id=[clientID]&client_secret=[clientSecret]&grant_type=authorization_code

我得到的答复是
$ curl: (6) Could not resolve host: POST{"url":"/oauth2/access_token?code=99ITPUMP","message":"404 Not Found"}

The response I get is
$ curl: (6) Could not resolve host: POST{"url":"/oauth2/access_token?code=99ITPUMP","message":"404 Not Found"}

我已尝试多次获取新的身份验证代码,但仍然无法获取任何内容.有人可以告诉我我做错了什么吗?我需要从bash控制台中的Nest获取基本信息.对于提供答案的任何人,请使其尽可能防白痴.我真的不知道自己在做什么,所以我正在努力学习.

I've tried getting a new auth code multiple times and still can't get anything. Can anybody tell me what I'm doing wrong? I need to get basic information from my Nest within the bash console. For anyone providing an answer, please make it is idiot-proof as possible. I really have no idea what I'm doing so I'm doing my best to learn.

推荐答案

尝试类似的方法:

curl --data'code = 99ITPUMP& client_id = [clientID]& client_secret = [clientSecret]& grant_type = authorization_code' https://api.home.nest.com/oauth2/access_token

curl --data 'code=99ITPUMP&client_id=[clientID]&client_secret=[clientSecret]&grant_type=authorization_code' https://api.home.nest.com/oauth2/access_token

这篇关于使用git bash授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 16:34