public static class HttpClient.HttpResponse extends Object implements Closeable
| Constructor and Description |
|---|
HttpResponse(int status) |
| Modifier and Type | Method and Description |
|---|---|
HttpClient.HttpResponse |
addHeader(String name,
String value) |
void |
close() |
byte[] |
entityAsBytes() |
String |
entityAsString() |
InputStream |
getContentStream() |
InputStream |
getEntity() |
String |
getHeader(String headerName) |
String |
getHeaderElement(String h,
String e) |
Map<String,String> |
getHeaders() |
Optional<String> |
getHeaderValue(String header) |
int |
getStatusCode() |
HttpClient.HttpResponse |
setEntity(InputStream body) |
HttpClient.HttpResponse |
setStatusLine(String statusLine) |
String |
toString() |
public int getStatusCode()
public HttpClient.HttpResponse setStatusLine(String statusLine)
public HttpClient.HttpResponse addHeader(String name, String value)
public HttpClient.HttpResponse setEntity(InputStream body)
public InputStream getContentStream()
public String entityAsString() throws IOException
IOExceptionpublic InputStream getEntity()
public byte[] entityAsBytes()
throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2021. All rights reserved.