Package org.keycloak.http
Interface HttpResponse
- All Known Implementing Classes:
HttpResponseImpl
public interface HttpResponse
Represents an out coming HTTP response.
Instances of this class can be obtained from KeycloakContext.getHttpResponse().
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a value to the current list of values for the header with the givenname.intGets a status code.voidsetCookieIfAbsent(jakarta.ws.rs.core.NewCookie cookie) Sets a new cookie only if not yet set.default voidsetCookieIfAbsent(HttpCookie cookie) Deprecated, for removal: This API element is subject to removal in a future version.This method will be removed in the future.voidSet a header.voidsetStatus(int statusCode) Sets a status code.
-
Method Details
-
getStatus
int getStatus()Gets a status code. -
setStatus
void setStatus(int statusCode) Sets a status code.- Parameters:
statusCode- the status code
-
addHeader
Add a value to the current list of values for the header with the givenname.- Parameters:
name- the header namevalue- the header value
-
setHeader
Set a header. Any existing values will be replaced.- Parameters:
name- the header namevalue- the header value
-
setCookieIfAbsent
void setCookieIfAbsent(jakarta.ws.rs.core.NewCookie cookie) Sets a new cookie only if not yet set.- Parameters:
cookie- the cookie
-
setCookieIfAbsent
Deprecated, for removal: This API element is subject to removal in a future version.This method will be removed in the future. Please useNewCookie.BuilderSets a new cookie only if not yet set.- Parameters:
cookie- the cookie
-