public class HttpAction extends TechnicalException
Modifier and Type | Field and Description |
---|---|
protected int |
code |
Modifier | Constructor and Description |
---|---|
protected |
HttpAction(int code) |
Modifier and Type | Method and Description |
---|---|
static HttpAction |
forbidden(WebContext context)
Build a forbidden response.
|
int |
getCode()
Return the HTTP code.
|
static HttpAction |
noContent(WebContext context)
Build an HTTP No content.
|
static HttpAction |
ok(WebContext context,
String content)
Build an HTTP Ok.
|
static HttpAction |
redirect(WebContext context,
String url)
Build a redirection.
|
static HttpAction |
status(int status,
WebContext context)
Build a response with status.
|
String |
toString() |
static HttpAction |
unauthorized(WebContext context)
Build a basic auth popup credentials.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
public static HttpAction status(int status, WebContext context)
status
- the HTTP statuscontext
- contextpublic static HttpAction redirect(WebContext context, String url)
context
- contexturl
- urlpublic static HttpAction ok(WebContext context, String content)
context
- contextcontent
- contentpublic static HttpAction noContent(WebContext context)
context
- contextpublic static HttpAction unauthorized(WebContext context)
context
- contextpublic static HttpAction forbidden(WebContext context)
context
- contextpublic int getCode()
Copyright © 2019. All rights reserved.