【发布时间】:2023-01-18 17:36:19
【问题描述】:
我的 HTTP Get 方法在本地运行良好,但在 WebLogic Server 上部署 EAR(应用程序的创建耳)后它无法运行。
我在单击按钮(ActionListener)时调用此方法
private String httpGetMethod(String number) {
String Result = null;
try {
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
//My API URL
String URL ="https://apilink";
Request request = new Request.Builder().url(URL).method("GET", null).build();
Response response = client.newCall(request).execute();
String InitResult = response.body().string();
Result=InitResult;
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return Result;
}
【问题讨论】:
-
您使用哪个确切的 JDev 版本?你得到什么错误?
标签: java oracle weblogic oracle-adf