mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修复options请求无响应体问题
This commit is contained in:
@@ -50,7 +50,8 @@ public class JdkClientEngine implements ClientEngine {
|
||||
/**
|
||||
* 构造
|
||||
*/
|
||||
public JdkClientEngine() {}
|
||||
public JdkClientEngine() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public JdkClientEngine init(final ClientConfig config) {
|
||||
@@ -214,14 +215,15 @@ public class JdkClientEngine implements ClientEngine {
|
||||
|
||||
/**
|
||||
* 是否忽略读取响应body部分<br>
|
||||
* HEAD、CONNECT、OPTIONS、TRACE方法将不读取响应体
|
||||
* HEAD、CONNECT、TRACE方法将不读取响应体
|
||||
*
|
||||
* @return 是否需要忽略响应body部分
|
||||
*/
|
||||
private static boolean isIgnoreResponseBody(final Method method) {
|
||||
return Method.HEAD == method //
|
||||
|| Method.CONNECT == method //
|
||||
|| Method.OPTIONS == method //
|
||||
private boolean isIgnoreResponseBody(final Method method) {
|
||||
//https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Methods/OPTIONS
|
||||
// OPTIONS请求可以带有响应体
|
||||
return Method.HEAD == method
|
||||
|| Method.CONNECT == method
|
||||
|| Method.TRACE == method;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user