| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private final String | responseBody
Record Component accessed by responseBody(). |
| private final String | responseMessage
Record Component accessed by responseMessage(). |
| private final int | statusCode
Record Component accessed by statusCode(). |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| private static String | Returns: the response body as a stringthe HttpURLConnection to read the response body from connection)Reads the response body from the HttpURLConnection and returns it as a string. |
| private static String | |
| private static String | |
| private static int | |
| public final int | |
| public String | |
| public String | |
| public int | |
| public String | toString()
Implements abstract java. Returns a string representation of the record. |
| private static String | Returns: the truncated response bodythe original response body responseBody)Truncates the response body to 1 KB if it exceeds that size. |
| MAX_RESPONSE_LENGTH | back to summary |
|---|---|
| private static final int MAX_RESPONSE_LENGTH | |
| responseBody | back to summary |
|---|---|
| private final String responseBody Record Component accessed by responseBody(). | |
| responseMessage | back to summary |
|---|---|
| private final String responseMessage Record Component accessed by responseMessage(). | |
| statusCode | back to summary |
|---|---|
| private final int statusCode Record Component accessed by statusCode(). | |
| SimpleHttpResponse | back to summary |
|---|---|
| public SimpleHttpResponse(int statusCode, String responseMessage, String responseBody) | |
| SimpleHttpResponse | back to summary |
|---|---|
| public SimpleHttpResponse(HttpURLConnection connection) | |
| SimpleHttpResponse | back to summary |
|---|---|
| public SimpleHttpResponse(HttpStatusException e) | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| getResponseBody | back to summary |
|---|---|
| private static String getResponseBody(HttpURLConnection connection) throws IOException Reads the response body from the HttpURLConnection and returns it as a string. This method is used to retrieve the response body from the connection, which may contain error messages or other information from the server.
| |
| getResponseBodyDefaultEmpty | back to summary |
|---|---|
| private static String getResponseBodyDefaultEmpty(HttpURLConnection connection) | |
| getResponseMessage | back to summary |
|---|---|
| private static String getResponseMessage(HttpURLConnection connection) | |
| getStatusCode | back to summary |
|---|---|
| private static int getStatusCode(HttpURLConnection connection) | |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| responseBody | back to summary |
|---|---|
| public String responseBody() Record Component getter of responseBody. | |
| responseMessage | back to summary |
|---|---|
| public String responseMessage() Record Component getter of responseMessage. | |
| statusCode | back to summary |
|---|---|
| public int statusCode() Record Component getter of statusCode. | |
| toString | back to summary |
|---|---|
| public String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.
| |
| truncateResponseBody | back to summary |
|---|---|
| private static String truncateResponseBody(String responseBody) Truncates the response body to 1 KB if it exceeds that size. Appends "... (truncated)" to indicate truncation. | |