惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
J
Java Code Geeks
IT之家
IT之家
Last Week in AI
Last Week in AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog RSS Feed
P
Proofpoint News Feed
博客园 - Franky
MongoDB | Blog
MongoDB | Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 【当耐特】
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ
B
Blog
Stack Overflow Blog
Stack Overflow Blog
Martin Fowler
Martin Fowler
博客园 - 聂微东
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
U
Unit 42
aimingoo的专栏
aimingoo的专栏

博客园 - 筱老邪

2026年读书清单,及java技术的巩固 图片转为为流的处理 编码和解码 SHA1签名算法,JAVA和C# C#与Java互通AES算法加密解密 在Java和C#中计算SHA-1哈希 .net5读取xml文件 部署linux 踩坑 多线程 .net知识点 下载文件,204问题 debug和release的web.config分开配置 数据库的索引查找 sql 查询出符合条件的表增加字段 HTTP状态码:400\500 错误代码 - 筱老邪 - 博客园 linq 两个list交集差集处理 rabbitMQ的使用 rabbitMQ的部署安装 sql 游标循环
请求处理
筱老邪 · 2025-05-19 · via 博客园 - 筱老邪
Mono mono1 = (Mono) createUnsafeWebClient().post()
.uri(path)
.contentType(MediaType.MULTIPART_FORM_DATA)
.header("Accept", "text/event-stream")
.body(BodyInserters.fromMultipartData(buildFormData(chatQo)))
.exchange();

ClientResponse response = (ClientResponse) mono1.block();

HttpStatus statusCode = response.statusCode(); // 获取响应码

int statusCodeValue = response.rawStatusCode(); // 获取响应码值
if (statusCodeValue == 401) {
ClientResponse.Headers headers = response.headers(); // 获取响应头

//String contentType= headers.asHttpHeaders().getContentType().toString();
if (headers.asHttpHeaders().getContentType().toString().equals("application/json;charset=UTF-8")) {
// HttpClientErrorException e;
// refreshToken(e);
Mono resultMono = response.bodyToMono(String.class);
Object body = resultMono.block();
//String body1 = resultMono.block();

return executeStreamRequest(path, chatQo, apiName);
}
}