Class Web.Result
- Enclosing class:
Web
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]getBody()getError()Non-null only when the transfer failed before producing a status.The FIRST value for a name, matched case-insensitively.The response headers, lower-cased names to values.getHeaderValues(String name) Every value the response carried for a name, in arrival order.intThe HTTP status, or -1 when the transfer itself failed.boolean
-
Method Details
-
getStatus
public int getStatus()The HTTP status, or -1 when the transfer itself failed. -
isSuccess
public boolean isSuccess() -
getBody
public byte[] getBody() -
getBodyAsString
-
getError
Non-null only when the transfer failed before producing a status. -
getHeaders
The response headers, lower-cased names to values.
A response's headers are half of what an API says -- the ETag S3 returns for a PUT, the content type of an object, the rate-limit budget a service publishes -- and a client that can only read the body cannot see any of it. Names are lower-cased because HTTP header names are case insensitive and a caller should not have to guess which case this server chose.
-
getHeader
The FIRST value for a name, matched case-insensitively. Null when absent.
First rather than last, which is what this used to answer -- and the two differ only for a field the response repeated, which is the case that was losing data. Use getHeaderValues for a field that is legitimately repeated: Set-Cookie is the one every response has, and its values cannot be joined back together because an Expires attribute contains a comma of its own.
-
getHeaderValues
-