public class JdkHttpResponseImpl extends java.lang.Object implements HttpResponse
构造器和说明 |
---|
JdkHttpResponseImpl(java.net.HttpURLConnection http) |
限定符和类型 | 方法和说明 |
---|---|
java.io.InputStream |
body()
获取响应主体
|
byte[] |
bodyAsBytes()
获取响应主体字节数组
|
java.lang.String |
bodyAsString()
获取响应主体字符串
|
void |
close() |
int |
code()
获取响应代码
|
java.nio.charset.Charset |
contentEncoding()
获取内容编码
|
java.lang.Long |
contentLength()
获取内容长度
|
java.lang.String |
contentType()
获取内容类型
|
java.util.List<java.lang.String> |
cookies()
获取小饼数组
|
java.lang.String |
header(java.lang.String name)
获取头值
|
java.util.Collection<java.lang.String> |
headerNames()
获取头名
|
java.util.List<java.lang.String> |
headers(java.lang.String name)
获取头值数组
|
public JdkHttpResponseImpl(java.net.HttpURLConnection http) throws java.io.IOException
java.io.IOException
public java.util.Collection<java.lang.String> headerNames()
HttpResponse
headerNames
在接口中 HttpResponse
public java.lang.String header(java.lang.String name)
HttpResponse
header
在接口中 HttpResponse
public java.util.List<java.lang.String> headers(java.lang.String name)
HttpResponse
headers
在接口中 HttpResponse
public java.lang.Long contentLength()
HttpResponse
contentLength
在接口中 HttpResponse
public java.lang.String contentType()
HttpResponse
contentType
在接口中 HttpResponse
public java.nio.charset.Charset contentEncoding()
HttpResponse
contentEncoding
在接口中 HttpResponse
public java.util.List<java.lang.String> cookies()
HttpResponse
cookies
在接口中 HttpResponse
public int code()
HttpResponse
code
在接口中 HttpResponse
public java.io.InputStream body()
HttpResponse
body
在接口中 HttpResponse
public byte[] bodyAsBytes() throws java.io.IOException
HttpResponse
bodyAsBytes
在接口中 HttpResponse
java.io.IOException
public java.lang.String bodyAsString() throws java.io.IOException
HttpResponse
bodyAsString
在接口中 HttpResponse
java.io.IOException
public void close() throws java.io.IOException
close
在接口中 java.io.Closeable
close
在接口中 java.lang.AutoCloseable
java.io.IOException