Package org.logdoc.fairhttp.service.http
Class Response
- java.lang.Object
-
- org.logdoc.fairhttp.service.tools.MapAttributed
-
- org.logdoc.fairhttp.service.http.Response
-
- Direct Known Subclasses:
WebSocket
public class Response extends MapAttributed
- Author:
- Denis Danilin | me@loslobos.ru 26.07.2023 17:28 fair-http-server ☭ sweat and blood
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Responseas(org.logdoc.helpers.std.MimeType mime)static ResponseClientError(String reason)static ResponseCreated()static ResponseForbidden()voidheader(String name, Object value)booleanis200()static ResponsejsonSuccess()static ResponseNoContent()static ResponseNotFound()static ResponseNotFound(String message)static ResponseOk()static ResponseServerError()static ResponseServerError(String reason)voidsetPayload(byte[] payload, org.logdoc.helpers.std.MimeType contentType)voidsetPromise(Consumer<OutputStream> promise)intsize()StringtoString()ResponsewithCookie(Cookie... cookies)ResponsewithHeader(String name, String value)-
Methods inherited from class org.logdoc.fairhttp.service.tools.MapAttributed
get, getAttribute, removeAttribute, setAttribute
-
-
-
-
Constructor Detail
-
Response
public Response(int code, String message)
-
-
Method Detail
-
jsonSuccess
public static Response jsonSuccess()
-
Ok
public static Response Ok()
-
Created
public static Response Created()
-
NoContent
public static Response NoContent()
-
NotFound
public static Response NotFound()
-
Forbidden
public static Response Forbidden()
-
ServerError
public static Response ServerError()
-
setPromise
public void setPromise(Consumer<OutputStream> promise)
-
setPayload
public void setPayload(byte[] payload, org.logdoc.helpers.std.MimeType contentType)
-
size
public int size()
-
as
public Response as(org.logdoc.helpers.std.MimeType mime)
-
is200
public boolean is200()
-
-