@Response(code=200, description="OK") public class Ok extends HttpResponse
Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request, the response will contain an entity describing or containing the result of the action.
Modifier and Type | Field and Description |
---|---|
static int |
CODE
HTTP status code
|
static Ok |
INSTANCE
Reusable instance.
|
static String |
MESSAGE
Default message
|
static Ok |
OK
Reusable instance.
|
Constructor and Description |
---|
Ok()
Constructor using HTTP-standard message.
|
Ok(String message)
Constructor using custom message.
|
Modifier and Type | Method and Description |
---|---|
Ok |
header(String name,
Object val)
Add an HTTP header to this response.
|
getHeaders, toString
public static final int CODE
public static final String MESSAGE
public Ok()
public Ok header(String name, Object val)
HttpResponse
header
in class HttpResponse
name
- The header name.val
- The header value.Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.