Package org.nuxeo.http.test
Class HttpResponse
- java.lang.Object
-
- org.nuxeo.http.test.HttpResponse
-
- Direct Known Subclasses:
CloseableHttpResponse
public class HttpResponse extends Object
- Since:
- 2023.13
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.http.client.methods.CloseableHttpResponseresponseprotected CloningInputStreamresponseStream
-
Constructor Summary
Constructors Modifier Constructor Description protectedHttpResponse(org.apache.http.client.methods.CloseableHttpResponse response)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamgetEntityInputStream()StringgetEntityString()StringgetFirstHeader(String headerName)URIgetLocation()Optional<String>getOptFirstHeader(String headerName)protected Optional<CloningInputStream>getResponseStream()intgetStatus()StringgetType()
-
-
-
Field Detail
-
response
protected final org.apache.http.client.methods.CloseableHttpResponse response
-
responseStream
protected CloningInputStream responseStream
-
-
Method Detail
-
getStatus
public int getStatus()
- Returns:
- the HTTP status code
-
getLocation
public URI getLocation()
- Returns:
- the
Locationheader value, if any
-
getType
public String getType()
- Returns:
- the
Content-Typeheader value, if any
-
getOptFirstHeader
public Optional<String> getOptFirstHeader(String headerName)
- Returns:
- the header value
-
getEntityInputStream
public InputStream getEntityInputStream()
- Returns:
- the entity body as
InputStream
-
getResponseStream
protected Optional<CloningInputStream> getResponseStream() throws IOException
- Throws:
IOException
-
-