@Signature public String method() { return request.getMethod(); }
final boolean expectPost = (httpRequest.getHeader("x-expect-post") != null); if (expectGet) { final String method = request.getMethod(); if (!"GET".equals(method)) { httpResponse.sendError(500, "Incorrect method. Expected GET, received " + method); return; } else if (expectPost) { final String method = request.getMethod(); if (!"POST".equals(method)) { httpResponse.sendError(500, "Incorrect method. Expected POST, received " + method);
@Override public void log(Request request, Response response) { if (logger.isDebugEnabled()) { logger.debug( "%s %s %s %s", request.getRemoteAddr(), request.getMethod(), request.getHttpURI().toString(), request.getProtocol() ); } } }
if (request.getMethod().equalsIgnoreCase("OPTIONS")) { httpResponse.addHeader("Allow", "GET,HEAD,POST,OPTIONS,TRACE");
baseUri, requestUri, request.getMethod(), getSecurityContext(request), new MapPropertiesDelegate());
String httpMethod = request.getMethod(); RoleInfo roleInfo = mappings.get(httpMethod); if (roleInfo == null)
@Override public String toString() { return (_handled?"[":"(") + getMethod() + " " + _uri + (_handled?"]@":")@") + hashCode() + " " + super.toString(); }
@Override public String toString() { return (_handled?"[":"(") + getMethod() + " " + _uri + (_handled?"]@":")@") + hashCode() + " " + super.toString(); }
@Override public String toString() { return (_handled?"[":"(") + getMethod() + " " + _uri + (_handled?"]@":")@") + hashCode() + " " + super.toString(); }
protected Object prepareConstraintInfo(String pathInContext, Request request) { String httpMethod = request.getMethod(); RestPathMap<RoleInfo> mappings = constraintMap.get(httpMethod); if (mappings != null) { RoleInfo roleInfo = mappings.match(pathInContext); if (roleInfo != null) { return roleInfo; } } return defaultRoleInfo; }
@Override public void handle( Request request, HttpServletResponse response ) { method.set(request.getMethod()); response.setStatus(HTTP_OK); } };
@Override public void handle( Request request, HttpServletResponse response ) { method.set(request.getMethod()); response.setStatus(HTTP_CREATED); } };
@Override public void handle( Request request, HttpServletResponse response ) { method.set(request.getMethod()); response.setStatus(HTTP_CREATED); } };
@Override public void earlyEOF() { // If we have no request yet, just close if (getRequest().getMethod()==null) close(); else super.earlyEOF(); }
@Override public void handle( Request request, HttpServletResponse response ) { method.set(request.getMethod()); outputParams.put("name", request.getParameter("name")); outputParams.put("number", request.getParameter("number")); response.setStatus(HTTP_OK); } };
@Override public void handle( Request request, HttpServletResponse response ) { method.set(request.getMethod()); outputParams.put("name", request.getParameter("name")); outputParams.put("number", request.getParameter("number")); response.setStatus(HTTP_OK); } };
@Override public void handle( Request request, HttpServletResponse response ) { method.set(request.getMethod()); outputParams.put("name", request.getParameter("name")); outputParams.put("number", request.getParameter("number")); response.setStatus(HTTP_OK); } };
@Override public void handle( Request request, HttpServletResponse response ) { method.set(request.getMethod()); outputParams.put("name", request.getParameter("name")); outputParams.put("number", request.getParameter("number")); response.setStatus(HTTP_OK); } };
@Override public void log(Request request, Response response) { Duration requestTime = new Duration(max(0, System.currentTimeMillis() - request.getTimeStamp()), TimeUnit.MILLISECONDS); long dispatchTime = request.getTimeStamp(); Duration schedulingDelay = new Duration(max(0, dispatchTime - request.getTimeStamp()), TimeUnit.MILLISECONDS); stats.record(request.getMethod(), response.getStatus(), request.getContentRead(), response.getContentCount(), schedulingDelay, requestTime); } }