public final class CloseableHttpResponse extends Object implements org.apache.hc.core5.http.ClassicHttpResponse, org.apache.hc.core5.io.ModalCloseable
Modifier and Type | Method and Description |
---|---|
static CloseableHttpResponse |
adapt(org.apache.hc.core5.http.ClassicHttpResponse response) |
void |
addHeader(org.apache.hc.core5.http.Header header) |
void |
addHeader(String name,
Object value) |
void |
close() |
void |
close(org.apache.hc.core5.io.CloseMode closeMode) |
boolean |
containsHeader(String name) |
int |
countHeaders(String name) |
int |
getCode() |
org.apache.hc.core5.http.HttpEntity |
getEntity() |
org.apache.hc.core5.http.Header |
getFirstHeader(String name) |
org.apache.hc.core5.http.Header |
getHeader(String name) |
org.apache.hc.core5.http.Header[] |
getHeaders() |
org.apache.hc.core5.http.Header[] |
getHeaders(String name) |
org.apache.hc.core5.http.Header |
getLastHeader(String name) |
Locale |
getLocale() |
String |
getReasonPhrase() |
org.apache.hc.core5.http.ProtocolVersion |
getVersion() |
Iterator<org.apache.hc.core5.http.Header> |
headerIterator() |
Iterator<org.apache.hc.core5.http.Header> |
headerIterator(String name) |
boolean |
removeHeader(org.apache.hc.core5.http.Header header) |
boolean |
removeHeaders(String name) |
void |
setCode(int code) |
void |
setEntity(org.apache.hc.core5.http.HttpEntity entity) |
void |
setHeader(org.apache.hc.core5.http.Header header) |
void |
setHeader(String name,
Object value) |
void |
setHeaders(org.apache.hc.core5.http.Header... headers) |
void |
setLocale(Locale loc) |
void |
setReasonPhrase(String reason) |
void |
setVersion(org.apache.hc.core5.http.ProtocolVersion version) |
String |
toString() |
@Internal public static CloseableHttpResponse adapt(org.apache.hc.core5.http.ClassicHttpResponse response)
public int getCode()
getCode
in interface org.apache.hc.core5.http.HttpResponse
public org.apache.hc.core5.http.HttpEntity getEntity()
getEntity
in interface org.apache.hc.core5.http.HttpEntityContainer
public boolean containsHeader(String name)
containsHeader
in interface org.apache.hc.core5.http.MessageHeaders
public void setVersion(org.apache.hc.core5.http.ProtocolVersion version)
setVersion
in interface org.apache.hc.core5.http.HttpMessage
public void setCode(int code)
setCode
in interface org.apache.hc.core5.http.HttpResponse
public String getReasonPhrase()
getReasonPhrase
in interface org.apache.hc.core5.http.HttpResponse
public int countHeaders(String name)
countHeaders
in interface org.apache.hc.core5.http.MessageHeaders
public void setEntity(org.apache.hc.core5.http.HttpEntity entity)
setEntity
in interface org.apache.hc.core5.http.HttpEntityContainer
public org.apache.hc.core5.http.ProtocolVersion getVersion()
getVersion
in interface org.apache.hc.core5.http.HttpMessage
public void setReasonPhrase(String reason)
setReasonPhrase
in interface org.apache.hc.core5.http.HttpResponse
public org.apache.hc.core5.http.Header[] getHeaders(String name)
getHeaders
in interface org.apache.hc.core5.http.MessageHeaders
public void addHeader(org.apache.hc.core5.http.Header header)
addHeader
in interface org.apache.hc.core5.http.HttpMessage
public Locale getLocale()
getLocale
in interface org.apache.hc.core5.http.HttpResponse
public void addHeader(String name, Object value)
addHeader
in interface org.apache.hc.core5.http.HttpMessage
public void setLocale(Locale loc)
setLocale
in interface org.apache.hc.core5.http.HttpResponse
public org.apache.hc.core5.http.Header getHeader(String name) throws org.apache.hc.core5.http.ProtocolException
getHeader
in interface org.apache.hc.core5.http.MessageHeaders
org.apache.hc.core5.http.ProtocolException
public void setHeader(org.apache.hc.core5.http.Header header)
setHeader
in interface org.apache.hc.core5.http.HttpMessage
public org.apache.hc.core5.http.Header getFirstHeader(String name)
getFirstHeader
in interface org.apache.hc.core5.http.MessageHeaders
public void setHeader(String name, Object value)
setHeader
in interface org.apache.hc.core5.http.HttpMessage
public void setHeaders(org.apache.hc.core5.http.Header... headers)
setHeaders
in interface org.apache.hc.core5.http.HttpMessage
public boolean removeHeader(org.apache.hc.core5.http.Header header)
removeHeader
in interface org.apache.hc.core5.http.HttpMessage
public boolean removeHeaders(String name)
removeHeaders
in interface org.apache.hc.core5.http.HttpMessage
public org.apache.hc.core5.http.Header getLastHeader(String name)
getLastHeader
in interface org.apache.hc.core5.http.MessageHeaders
public org.apache.hc.core5.http.Header[] getHeaders()
getHeaders
in interface org.apache.hc.core5.http.MessageHeaders
public Iterator<org.apache.hc.core5.http.Header> headerIterator()
headerIterator
in interface org.apache.hc.core5.http.MessageHeaders
public Iterator<org.apache.hc.core5.http.Header> headerIterator(String name)
headerIterator
in interface org.apache.hc.core5.http.MessageHeaders
public void close(org.apache.hc.core5.io.CloseMode closeMode)
close
in interface org.apache.hc.core5.io.ModalCloseable
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.