每当我运行这个命令
py -m googlesamples.assistant.auth_helpers -client-secrets <secrete-location>
Run Code Online (Sandbox Code Playgroud)
我收到一个错误说:
C:\Users\chand\AppData\Local\Programs\Python\Python36\python.exe:
No module named googlesamples.assistant.auth_helpers
Run Code Online (Sandbox Code Playgroud)
我不确定问题是什么,因为它在具有相同步骤的不同设备上工作.
每隔几个请求就会发生这种奇怪的事情,Go 的http包会抛出以下错误:
http2: server sent GOAWAY and closed the connection; LastStreamID=19999, ErrCode=NO_ERROR, debug=""
Run Code Online (Sandbox Code Playgroud)
所以我意识到默认传输已ForceAttemptHTTP2设置为true(https://golang.org/src/net/http/transport.go第 48 行),所以我手动将其设置为 false ,如下所示:
transport := &http.Transport{
ForceAttemptHTTP2: false,
}
httpClient := &http.Client{Transport: transport}
Run Code Online (Sandbox Code Playgroud)
但即使这样做之后,我仍然得到相同的 http2 错误而不是 http1,这对我来说没有意义?
我是网络新手,所以我感觉我错过了一些在这里应该很明显的东西?
我想问题是如何强制该http包仅使用http而不使用http2