不可靠的 NEST 休息 API
Unreliable NEST Rest API
在使用 auth 令牌进行 oauthing 之后,我进行了几次 api 调用。
问题是响应不可靠,有时某些请求按预期工作,而在其他时候它们不工作,并且没有确定性的方法来查找为什么以及何时不工作。
例如,使用相同的身份验证令牌(在此处编辑)- 我在不同的迭代中进行了以下 api 调用,并将结果粘贴到下面。
https://developer-api.nest.com/structures
https://developer-api.nest.com/devices/smoke_co_alarms
https://developer-api.nest.com/devices/thermostats
HttpRequest(https://developer-api.nest.com/structures, GET, ,List((auth, some_auth_token)),List((User-Agent, scalaj-http/1.0), (content-Type, application/json)), 列表(, , ), DIRECT, UTF-8, 4096, true)
No Response
HttpRequest(https://developer-api.nest.com/devices/smoke_co_alarms, GET, ,List((auth, some_auth_token)), List((User-Agent, scalaj-http/1.0), (content-Type, application/json)), 列表(, , ), DIRECT, UTF-8, 4096, true)
HttpRequest(https://developer-api.nest.com/structures, GET, , List((auth, some_auth_token)),List((User-Agent, scalaj-http/1.0), (content-Type, application/json)), 列表(, , ), DIRECT, UTF-8, 4096, true)
HttpRequest(https://developer-api.nest.com/devices/thermostats, GET, List((auth, some_auth_token)),List((User-Agent, scalaj-http/1.0), (content-Type, application/json)), 列表(, , ), DIRECT, UTF-8, 4096, true)
No Response
我相当确定这是 NEST API 的问题。还有其他人遇到过类似的问题吗?
你做了什么或者你建议我尝试什么?
- 我只想进行 REST API 调用 - 没有 firebase 等
- 来自终端的 CURL 请求始终如一地工作
你能用 gist 或 pastebin 吗?格式难以阅读。
来自 OP:
I figured out the issue. I hadn't enabled the option to follow
temporary redirects and the null response was because I was only
extracting the body. I completely missed that I was extracting the
body content while printing the response
在使用 auth 令牌进行 oauthing 之后,我进行了几次 api 调用。
问题是响应不可靠,有时某些请求按预期工作,而在其他时候它们不工作,并且没有确定性的方法来查找为什么以及何时不工作。
例如,使用相同的身份验证令牌(在此处编辑)- 我在不同的迭代中进行了以下 api 调用,并将结果粘贴到下面。
https://developer-api.nest.com/structures
https://developer-api.nest.com/devices/smoke_co_alarms
https://developer-api.nest.com/devices/thermostats
HttpRequest(https://developer-api.nest.com/structures, GET, ,List((auth, some_auth_token)),List((User-Agent, scalaj-http/1.0), (content-Type, application/json)), 列表(, , ), DIRECT, UTF-8, 4096, true)
No Response
HttpRequest(https://developer-api.nest.com/devices/smoke_co_alarms, GET, ,List((auth, some_auth_token)), List((User-Agent, scalaj-http/1.0), (content-Type, application/json)), 列表(, , ), DIRECT, UTF-8, 4096, true)
HttpRequest(https://developer-api.nest.com/structures, GET, , List((auth, some_auth_token)),List((User-Agent, scalaj-http/1.0), (content-Type, application/json)), 列表(, , ), DIRECT, UTF-8, 4096, true)
HttpRequest(https://developer-api.nest.com/devices/thermostats, GET, List((auth, some_auth_token)),List((User-Agent, scalaj-http/1.0), (content-Type, application/json)), 列表(, , ), DIRECT, UTF-8, 4096, true)
No Response
我相当确定这是 NEST API 的问题。还有其他人遇到过类似的问题吗?
你做了什么或者你建议我尝试什么?
- 我只想进行 REST API 调用 - 没有 firebase 等
- 来自终端的 CURL 请求始终如一地工作
你能用 gist 或 pastebin 吗?格式难以阅读。
来自 OP:
I figured out the issue. I hadn't enabled the option to follow temporary redirects and the null response was because I was only extracting the body. I completely missed that I was extracting the body content while printing the response