Examples of HttpMethod


Examples of com.openshift.client.HttpMethod

  }

  public RestResponse request(Link link, Map<String, Object> parameters)
      throws OpenShiftException {
    validateParameters(parameters, link);
    HttpMethod httpMethod = link.getHttpMethod();
    String response = request(link.getHref(), httpMethod, parameters);
    return ResourceDTOFactory.get(response);
  }
View Full Code Here

Examples of com.ramforth.webserver.http.HttpMethod

        HttpBuffer requestLineBuffer = readRequestLine(is);
        String requestLine = requestLineBuffer.toString();

        String[] result = requestLine.split("\\s");

        HttpMethod method;
        IHttpVersion version;
        URI uri;

        if (result.length == 3) {
            String methodString = result[0].trim();
View Full Code Here

Examples of er.rest.routes.jsr311.HttpMethod

        }

        ERXRoute.Method method = null;
        // Search annotations for @PUT, @GET, etc.
        for (Annotation annotation : routeMethod.getAnnotations()) {
          HttpMethod httpMethod = annotation.annotationType().getAnnotation(HttpMethod.class);
          if (httpMethod != null) {
            if (method == null) {
              method = httpMethod.value();
            }
            else {
              throw new IllegalArgumentException(routeControllerClass.getSimpleName() + "." + routeMethod.getName() + " is annotated as more than one http method.");
            }
          }
View Full Code Here

Examples of io.netty.handler.codec.http.HttpMethod

                throw new NoTypeConversionAvailableException(body, ByteBuf.class);
            }
        }

        // update HTTP method accordingly as we know if we have a body or not
        HttpMethod method = NettyHttpHelper.createMethod(message, body != null);
        request.setMethod(method);
       
        TypeConverter tc = message.getExchange().getContext().getTypeConverter();

        // if we bridge endpoint then we need to skip matching headers with the HTTP_QUERY to avoid sending
View Full Code Here

Examples of io.vertx.core.http.HttpMethod

    }

    protected boolean shouldReadData(HttpServerRequest vertxRequest) {

        HttpMethod method = vertxRequest.method();

        // Only read input stream data for post/put methods
        if (!(HttpMethod.POST == method || HttpMethod.PUT == method)) {
            return false;
        }
View Full Code Here

Examples of javax.ws.rs.HttpMethod

        MethodMetadata metadata = new MethodMetadata(getMetadata());
        metadata.setReflectionMethod(method);

        boolean hasAnnotation = false;

        HttpMethod httpMethod = getHttpMethod(method);
        if (httpMethod != null) {
            hasAnnotation = true;
            metadata.setHttpMethod(httpMethod.value());
        }

        Path path = getPath(method);
        if (path != null) {
            hasAnnotation = true;
View Full Code Here

Examples of juzu.HttpMethod

    boolean[] doOutput = { false, true, true, true };
    URL url = applicationURL();
    for (int i = 0;i < methods.length;i++) {
      HttpURLConnection conn = (HttpURLConnection)url.openConnection();
      conn.setDoOutput(doOutput[i]);
      HttpMethod method = methods[i];
      conn.setRequestMethod(method.name());
      assertEquals(200, conn.getResponseCode());
      String ret = Tools.read(conn.getInputStream());
      assertTrue("Was expecting " + ret + " to container ok[" + method + "]", ret.contains("ok[" + method + "]"));
    }
  }
View Full Code Here

Examples of net.hasor.mvc.web.restful.HttpMethod

        /*HttpMethod*/
        Annotation[] annos = targetMethod.getAnnotations();
        ArrayList<String> allHttpMethod = new ArrayList<String>();
        if (annos != null) {
            for (Annotation anno : annos) {
                HttpMethod httpMethodAnno = anno.annotationType().getAnnotation(HttpMethod.class);
                if (httpMethodAnno != null) {
                    String bindMethod = httpMethodAnno.value();
                    if (StringUtils.isBlank(bindMethod) == false)
                        allHttpMethod.add(bindMethod);
                }
            }
        }
View Full Code Here

Examples of net.sf.chellow.monad.Invocation.HttpMethod

  public String getServletInfo() {
    return "Chellow electricity billing and reporting.";
  }

  protected void checkPermissions(Invocation inv) throws HttpException {
    HttpMethod method = inv.getMethod();
    String pathInfo = inv.getRequest().getPathInfo();

    if (method.equals(HttpMethod.GET)
        && (pathInfo.equals("/") || pathInfo.startsWith("/style/"))) {
      return;
    }
    User user = inv.getUser();
    if (user == null) {
      user = ImplicitUserSource.getUser(inv);
    }
    if (user == null) {
      try {
        Long userCount = (Long) Hiber.session()
            .createQuery("select count(*) from User user")
            .uniqueResult();
        if (userCount == null
            || userCount == 0
            && InetAddress.getByName(
                inv.getRequest().getRemoteAddr())
                .isLoopbackAddress()) {
          return;
        }
      } catch (UnknownHostException e) {
        throw new InternalException(e);
      }
      throw new UnauthorizedException();
    }
    UserRole role = user.getRole();
    String roleCode = role.getCode();
    if (roleCode.equals(UserRole.VIEWER)) {
      if (pathInfo.startsWith("/reports/")
          && pathInfo.endsWith("/output/")
          && (method.equals(HttpMethod.GET) || method
              .equals(HttpMethod.HEAD))) {
        return;
      }
    } else if (roleCode.equals(UserRole.EDITOR)) {
      return;
    } else if (roleCode.equals(UserRole.PARTY_VIEWER)) {
      if (method.equals(HttpMethod.GET) || method.equals(HttpMethod.HEAD)) {
        Party party = user.getParty();
        char marketRoleCode = party.getRole().getCode();
        if (marketRoleCode == MarketRole.HHDC) {
          Long hhdcContractId = inv.getLong("hhdc-contract-id");
          if (!inv.isValid()) {
View Full Code Here

Examples of opendap.dap.http.HTTPMethod

    // have to do dods first
    ServiceType result = checkIfDods(session,location);
    if (result != null)
      return result;

    HTTPMethod method = null;
    try {
      method = session.newMethodHead(location);
      int statusCode = method.execute();
      if (statusCode >= 300) {
        if (statusCode == 401)
          throw new IOException("Unauthorized to open dataset " + location);
        else
          throw new IOException(location + " is not a valid URL, return status=" + statusCode);
      }

      Header h = method.getResponseHeader("Content-Description");
      if ((h != null) && (h.getValue() != null)) {
        String v = h.getValue();
        if (v.equalsIgnoreCase("ncstream"))
          return ServiceType.CdmRemote;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.