Package io.github.parthappm.http.client
Class Response
java.lang.Object
io.github.parthappm.http.client.Response
The Response class contains all the data related to HTTP response returned by the server
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getBody()
Getter method to get the response body as bytes array.Getter method to get the response headers.int
Getter method to get the response status code.Getter method to get the response status text.getText()
Getter method to get the response body as String representation decoded by UTF 8 standard.Getter method to get the HTTP version specified by the server in the response.
-
Method Details
-
getVersion
Getter method to get the HTTP version specified by the server in the response.- Returns:
- The HTTP version specified by the server in the response
-
getStatusCode
public int getStatusCode()Getter method to get the response status code.- Returns:
- The response status code
-
getStatusText
Getter method to get the response status text.- Returns:
- The response status text
-
getHeaders
Getter method to get the response headers.- Returns:
- The response headers
-
getBody
public byte[] getBody()Getter method to get the response body as bytes array.- Returns:
- The response body as byte array
-
getText
Getter method to get the response body as String representation decoded by UTF 8 standard.- Returns:
- The response body as String representation decoded by UTF 8 standard
-