类 JdkHttpClientResponse
- java.lang.Object
-
- com.alibaba.nacos.common.http.client.response.JdkHttpClientResponse
-
- 所有已实现的接口:
HttpClientResponse,java.io.Closeable,java.lang.AutoCloseable
public class JdkHttpClientResponse extends java.lang.Object implements HttpClientResponse
JDk http client response implement.- 作者:
- mai.jh
-
-
字段概要
字段 修饰符和类型 字段 说明 private java.net.HttpURLConnectionconnprivate static java.lang.StringCONTENT_ENCODINGprivate HeaderresponseHeaderprivate java.io.InputStreamresponseStream
-
构造器概要
构造器 构造器 说明 JdkHttpClientResponse(java.net.HttpURLConnection conn)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidclose()close response InputStream.java.io.InputStreamgetBody()Return the body of the message as an input stream.HeadergetHeaders()Return the headers of this message.intgetStatusCode()Return the HTTP status code.java.lang.StringgetStatusText()Return the HTTP status text of the response.
-
-
-
方法详细资料
-
getHeaders
public Header getHeaders()
从接口复制的说明:HttpClientResponseReturn the headers of this message.- 指定者:
getHeaders在接口中HttpClientResponse- 返回:
- a corresponding HttpHeaders object (never
null)
-
getBody
public java.io.InputStream getBody() throws java.io.IOException从接口复制的说明:HttpClientResponseReturn the body of the message as an input stream.- 指定者:
getBody在接口中HttpClientResponse- 返回:
- String response body
- 抛出:
java.io.IOException- IOException
-
getStatusCode
public int getStatusCode() throws java.io.IOException从接口复制的说明:HttpClientResponseReturn the HTTP status code.- 指定者:
getStatusCode在接口中HttpClientResponse- 返回:
- the HTTP status as an integer
- 抛出:
java.io.IOException- IOException
-
getStatusText
public java.lang.String getStatusText() throws java.io.IOException从接口复制的说明:HttpClientResponseReturn the HTTP status text of the response.- 指定者:
getStatusText在接口中HttpClientResponse- 返回:
- the HTTP status text
- 抛出:
java.io.IOException- IOException
-
close
public void close()
从接口复制的说明:HttpClientResponseclose response InputStream.- 指定者:
close在接口中java.lang.AutoCloseable- 指定者:
close在接口中java.io.Closeable- 指定者:
close在接口中HttpClientResponse
-
-