java.lang.Object
io.helidon.webclient.http1.UpgradeResponse
Response to an upgrade attempt.
-
Method Summary
Modifier and TypeMethodDescriptionUpgraded connection.static UpgradeResponse
failure
(HttpClientResponse response) Create an upgrade failure response.boolean
Whether upgrade succeeded or not.response()
The HTTP response we got from the server, always present.static UpgradeResponse
success
(HttpClientResponse response, ClientConnection connection) Create an upgrade success response.toString()
-
Method Details
-
success
Create an upgrade success response.- Parameters:
response
- the HTTP/1.1 response that was returned (successful upgrade)connection
- client connection, now upgraded to the requested protocol on server side- Returns:
- upgrade response that was successful
-
failure
Create an upgrade failure response.- Parameters:
response
- the HTTP/1.1 client response that was returned instead of upgrading the connection- Returns:
- upgrade response that failed to upgrade
-
toString
-
isUpgraded
public boolean isUpgraded()Whether upgrade succeeded or not.- Returns:
- whether we upgraded the connection
-
connection
Upgraded connection. Only available on successful upgrade, will throw an exception otherwise.- Returns:
- connection
- Throws:
NoSuchElementException
- in case the upgrade failed- See Also:
-
response
The HTTP response we got from the server, always present.- Returns:
- response as received by the HTTP/1 client
-