Package dev.gmitch215.bytebox.net.http
Class HttpResponse<T>
java.lang.Object
dev.gmitch215.bytebox.net.http.HttpResponse<T>
- Type Parameters:
T- what the body was read as
A response, standing in for
java.net.http.HttpResponse.- Since:
- 1.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classHow to read a body.static final classThe ways to read a body. -
Method Summary
Modifier and TypeMethodDescriptionbody()Returns the body, read the way the handler asked for.headers()Returns the response headers.Returns the response that redirected to this one, which is never present: fetch hides them.request()Returns the request this answers.intReturns the status code.toString()uri()Returns the URI the body came from, which differs from the request's after a redirect.
-
Method Details
-
statusCode
public int statusCode()Returns the status code.- Returns:
- the status code
-
headers
Returns the response headers.- Returns:
- the response headers
-
body
Returns the body, read the way the handler asked for.- Returns:
- the body, read the way the handler asked for
-
request
Returns the request this answers.- Returns:
- the request this answers
-
uri
Returns the URI the body came from, which differs from the request's after a redirect.- Returns:
- the URI the body came from, which differs from the request's after a redirect
-
previousResponse
Returns the response that redirected to this one, which is never present: fetch hides them.- Returns:
- the response that redirected to this one, which is never present: fetch hides them
-
toString
-