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.CloseableHttpResponse
response
protected CloningInputStream
responseStream
-
Constructor Summary
Constructors Modifier Constructor Description protected
HttpResponse(org.apache.http.client.methods.CloseableHttpResponse response)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStream
getEntityInputStream()
String
getEntityString()
String
getFirstHeader(String headerName)
URI
getLocation()
Optional<String>
getOptFirstHeader(String headerName)
protected Optional<CloningInputStream>
getResponseStream()
int
getStatus()
String
getType()
-
-
-
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
Location
header value, if any
-
getType
public String getType()
- Returns:
- the
Content-Type
header 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
-
-