gpt4 book ai didi

java.io.IOException : unexpected end of stream on Connection? 异常

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:46:16 24 4
gpt4 key购买 nike

<分区>

调用我们的内部网络服务之一似乎出现以下错误:

java.io.IOException: unexpected end of stream on Connection{webservicessandbox.xxx.com:443, proxy=DIRECT@ hostAddress=174.143.185.13 cipherSuite=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA protocol=http/1.1} (recycle count=0)

从我在其他地方看到的情况来看,这被认为是服务器问题,但是当在浏览器或 IOS 中调用 WS 时,我们没有看到这个问题。我同时使用了 OkHTTP 和手动 HTTPUrlConnection 实现,它似乎没有任何区别。有人有什么想法吗?

OKHttp:
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.addHeader("Authorization", "Bearer " + apiToken)
.addHeader("content-type", "application/json")
.url(uri)
.build();
HTTPURLConnection:
URL myURL = new URL(uri);
HttpsURLConnection myConnection = (HttpsURLConnection) myURL.openConnection();
myConnection.setConnectTimeout(TIMEOUT_MILLISEC);
myConnection.setDoOutput(false);
myConnection.setRequestMethod("GET");
myConnection.setRequestProperty("Authorization", "Bearer " + apiToken);
myConnection.setRequestProperty("content-type", "application/json");
int respCode = myConnection.getResponseCode();

24 4 0