请求失败,结果为:class java.util.LinkedHashMap cannot be cast to class com.zy.api.Computer (java.util.LinkedHashMap is in module java.base of loader 'bootstrap'; com.zy.api.Computer is in unnamed module of loader 'app')
byte[] bytes = new byte[dataBuffer.readableByteCount()];
dataBuffer.read(bytes);
baos.write(bytes);
DataBufferUtils.release(dataBuffer);
} catch (IOException e) {
e.printStackTrace();
DataBufferUtils.release(dataBuffer);
return null;
}
return baos;
})
.map(byteArrayOutputStream -> {
if (byteArrayOutputStream == null) return null;
return byteArrayOutputStream.toByteArray();
});
response.subscribe(result -> {
System.out.println("请求成功");
if (result != null) System.out.println("result length is " + result.length);
}, throwable -> {
throwable.printStackTrace();
});
复制代码
输出效果
org.springframework.web.reactive.function.client.WebClientRequestException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target