gpt4 book ai didi

android - OkHttp 不断收到 StreamResetException : stream was reset: INTERNAL_ERROR when it's 200

转载 作者:行者123 更新时间:2023-12-04 17:22:53 28 4
gpt4 key购买 nike

我得到了StreamResetException: stream was reset: INTERNAL_ERROR来自 OkHttp。有什么问题?
这是日志。

I/okhttp.OkHttpClient: <-- 200 https://www.example.com/user/list (396ms)
I/okhttp.OkHttpClient: date: Fri, 04 Dec 2020 02:21:35 GMT
I/okhttp.OkHttpClient: content-type: application/json
I/okhttp.OkHttpClient: content-length: 99730
I/okhttp.OkHttpClient: server: nginx/1.18.0
I/okhttp.OkHttpClient: allow: GET, HEAD, OPTIONS
I/okhttp.OkHttpClient: x-frame-options: DENY
I/okhttp.OkHttpClient: x-content-type-options: nosniff
I/okhttp.OkHttpClient: referrer-policy: same-origin
D/okhttp.Http2: << 0x00000003 5792 DATA
D/okhttp.Http2: << 0x00000003 4 RST_STREAM
D/okhttp.TaskRunner: Q10092 canceled : OkHttp ConnectionPool
D/force: okhttp3.internal.http2.StreamResetException: stream was reset: INTERNAL_ERROR
D/okhttp.Http2: >> 0x00000000 8 GOAWAY
D/okhttp.TaskRunner: Q10096 finished run in 216 ms: OkHttp www.example.com
这是在 Okhttp Gihub 存储库中发布的。但是还没有解决任何问题。
我这样调用API
    @Headers("Content-Type: application/json")
@GET("/user/list")
fun getUserList(@Header("Authorization") jwt: String): Call<ArrayList<UserData>>
这是200,但我什么也没得到。这是非常奇怪的行为..
是服务器问题还是我的问题? (服务器是 Django)。

最佳答案

这是 Nginx 缓冲区大小问题。
如果您使用的是 AWS EC2,
转至 /etc/nginx/default.d/server.conf并设置,

proxy_redirect off;
proxy_buffering off;

关于android - OkHttp 不断收到 StreamResetException : stream was reset: INTERNAL_ERROR when it's 200,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65137191/

28 4 0