本文整理了Java中ro.pippo.core.Response.status
方法的一些代码示例,展示了Response.status
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.status
方法的具体详情如下:
包路径:ro.pippo.core.Response
类名称:Response
方法名:status
[英]Sets the status code of the response.
[中]设置响应的状态代码。
代码示例来源:origin: pippo-java/pippo
/**
* Set the response status to BAD REQUEST (400).
* <p>
* The server cannot or will not process the request due to something that
* is perceived to be a client error.
* </p>
*
*/
public Response badRequest() {
status(HttpConstants.StatusCode.BAD_REQUEST);
return this;
}
代码示例来源:origin: pippo-java/pippo
/**
* Set the response status to PAYMENT REQUIRED (402).
* <p>
* Reserved for future use. The original intention was that this code might
* be used as part of some form of digital cash or micropayment scheme, but
* that has not happened, and this code is not usually used.
* </p>
*/
public Response paymentRequired() {
status(HttpConstants.StatusCode.PAYMENT_REQUIRED);
return this;
}
代码示例来源:origin: pippo-java/pippo
/**
* Set the response status to NOT FOUND (404).
* <p>
* The requested resource could not be found but may be available again in
* the future. Subsequent requests by the client are permissible.
* </p>
*
*/
public Response notFound() {
status(HttpConstants.StatusCode.NOT_FOUND);
return this;
}
代码示例来源:origin: pippo-java/pippo
/**
* Set the response status to OVERLOADED (502).
* <p>
* The server is currently unavailable (because it is overloaded or down
* for maintenance). Generally, this is a temporary state.
* </p>
*/
public Response overloaded() {
status(HttpConstants.StatusCode.OVERLOADED);
return this;
}
代码示例来源:origin: pippo-java/pippo
@Override
public RouteContext status(int code) {
response.status(code);
return this;
}
代码示例来源:origin: pippo-java/pippo
/**
* Set the response status to ACCEPTED (202).
* <p>
* The request has been accepted for processing, but the processing has not
* been completed. The request might or might not eventually be acted upon,
* as it might be disallowed when processing actually takes place.
* </p>
*
*/
public Response accepted() {
status(HttpConstants.StatusCode.ACCEPTED);
return this;
}
代码示例来源:origin: pippo-java/pippo
/**
* Set the response status to UNAUTHORIZED (401).
* <p>
* Similar to 403 Forbidden, but specifically for use when authentication is
* required and has failed or has not yet been provided. The response must
* include a WWW-Authenticate header field containing a challenge applicable
* to the requested resource.
* </p>
*/
public Response unauthorized() {
status(HttpConstants.StatusCode.UNAUTHORIZED);
return this;
}
代码示例来源:origin: pippo-java/pippo
/**
* Set the response status to CREATED (201).
* <p>
* The request has been fulfilled and resulted in a new resource being created.
* </p>
*
*/
public Response created() {
status(HttpConstants.StatusCode.CREATED);
return this;
}
代码示例来源:origin: pippo-java/pippo
/**
* Set the response status to CONFLICT (409).
* <p>
* Indicates that the request could not be processed because of conflict in
* the request, such as an edit conflict in the case of multiple updates.
* </p>
*
*/
public Response conflict() {
status(HttpConstants.StatusCode.CONFLICT);
return this;
}
代码示例来源:origin: pippo-java/pippo
/**
* Set the response status to INTERNAL ERROR (500).
* <p>
* A generic error message, given when an unexpected condition was
* encountered and no more specific message is suitable.
* </p>
*
*/
public Response internalError() {
status(HttpConstants.StatusCode.INTERNAL_ERROR);
return this;
}
代码示例来源:origin: pippo-java/pippo
/**
* Set the response status to SERVICE UNAVAILABLE (503).
* <p>
* The server is currently unavailable (because it is overloaded or down
* for maintenance). Generally, this is a temporary state.
* </p>
*/
public Response serviceUnavailable() {
status(HttpConstants.StatusCode.SERVICE_UNAVAILABLE);
return this;
}
代码示例来源:origin: pippo-java/pippo
/**
* Set the response status to GONE (410).
* <p>
* Indicates that the resource requested is no longer available and will not
* be available again. This should be used when a resource has been
* intentionally removed and the resource should be purged. Upon receiving a
* 410 status code, the client should not request the resource again in the
* future.
* </p>
*
*/
public Response gone() {
status(HttpConstants.StatusCode.GONE);
return this;
}
代码示例来源:origin: pippo-java/pippo
/**
* Set the response status to FORBIDDEN (403).
* <p>
* The request was a valid request, but the server is refusing to respond to
* it. Unlike a 401 Unauthorized response, authenticating will make no
* difference.
* </p>
*
*/
public Response forbidden() {
status(HttpConstants.StatusCode.FORBIDDEN);
return this;
}
代码示例来源:origin: pippo-java/pippo
/**
* Set the response status to METHOD NOT ALLOWED (405).
* <p>
* A request was made of a resource using a request method not supported
* by that resource; for example, using GET on a form which requires data
* to be presented via POST, or using PUT on a read-only resource.
* </p>
*
*/
public Response methodNotAllowed() {
status(HttpConstants.StatusCode.METHOD_NOT_ALLOWED);
return this;
}
代码示例来源:origin: pippo-java/pippo
/**
* Set the response status to NOT IMPLEMENTED (501).
* <p>
* The server either does not recognize the request method, or it lacks the
* ability to fulfil the request. Usually this implies future availability
* (e.g., a new feature of a web-service API).
* </p>
*
*/
public Response notImplemented() {
status(HttpConstants.StatusCode.NOT_IMPLEMENTED);
return this;
}
代码示例来源:origin: pippo-java/pippo
/**
* Set the response status to OK (200).
* <p>
* 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.
* </p>
*
*/
public Response ok() {
status(HttpConstants.StatusCode.OK);
return this;
}
代码示例来源:origin: pippo-java/pippo
@Override
public void setResponseStatus(int statusCode) {
getResponse().status(statusCode);
}
代码示例来源:origin: pippo-java/pippo
/**
* A permanent (3XX status code) redirect.
* <p>This method commits the response.</p>
*
* @param location
* @param statusCode
*/
public void redirect(String location, int statusCode) {
checkCommitted();
finalizeResponse();
status(statusCode);
header(HttpConstants.Header.LOCATION, location);
header(HttpConstants.Header.CONNECTION, "close");
try {
httpServletResponse.sendError(statusCode);
} catch (IOException e) {
throw new PippoRuntimeException(e);
}
}
内容来源于网络,如有侵权,请联系作者删除!