gpt4 book ai didi

android - 改造 - 后续请求过多 : 21

转载 作者:可可西里 更新时间:2023-11-01 18:47:01 24 4
gpt4 key购买 nike

我正在使用改造来发出请求。

出现以下错误:

java.net.ProtocolException: Too many follow-up requests: 21

代码如下:

private OkHttpClient httpClient;
private CookieManager cookieManager;

public <S> S createCookieService(Class<S> serviceClass) {
httpClient.interceptors().clear();
httpClient.setCookieHandler(cookieManager);
Retrofit.Builder builder = new Retrofit
.Builder()
.client(httpClient)
.baseUrl(url)
.addConverterFactory(GsonConverterFactory.create());

Retrofit retrofit = builder.client(httpClient).build();

return retrofit.create(serviceClass);
}

然后我提出请求:

例子:

1)登录

 @POST("/login")
Call<User> login();

2) 一些请求:

@GET("/request")
Call<PojoPojo> getPojo();

我收到此错误的后续请求太多:21。

请帮忙。

最佳答案

jack 沃顿写道:

This gets thrown (by OkHttp, not Retrofit) when there are more than 20 redirects when calling an endpoint. Usually this indicates a redirect cycle between two endpoints. Both Chrome and Firefox will also stop loading the request after this many redirects and fail the request.

You need to consult with your server team or endpoint documentation to ensure you are passing the correct data directly to the endpoint you want to call. No action for Retrofit to take here.

线程的其余部分在那里: https://github.com/square/retrofit/issues/1561

关于android - 改造 - 后续请求过多 : 21,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35132330/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com