Examples of HttpMethod


Examples of br.com.caelum.vraptor.controller.HttpMethod

    MutableRequest request = info.getRequest();
    String controllerName = info.getRequestedUri();

    logger.debug("trying to access {}", controllerName);

    HttpMethod method = getHttpMethod(request, controllerName);
    ControllerMethod controller = router.parse(controllerName, method, request);

    logger.debug("found controller {}", controller);
    return controller;
  }
View Full Code Here

Examples of br.com.caelum.vraptor.resource.HttpMethod

  }


  @Test
  public void passesTheWebMethod() throws SecurityException, NoSuchMethodException {
    HttpMethod delete = HttpMethod.DELETE;
    Route route = mock(Route.class);
   
    when(route.canHandle("/clients/add")).thenReturn(true);
    when(route.allowedMethods()).thenReturn(EnumSet.of(delete));
    when(route.resourceMethod(request, "/clients/add")).thenReturn(method);
View Full Code Here

Examples of com.apitrary.api.common.HttpMethod

   * @param <T>
   *            a T object.
   * @return a {@link com.apitrary.api.response.Response} object.
   */
  protected <T> Response<T> dispatchByMethod(Request<T> request) {
    HttpMethod method = HttpMethodUtil.retrieveMethod(request);

    switch (method) {
      case GET:
        return doGet(request);
      case POST:
View Full Code Here

Examples of com.atlassian.connect.play.java.http.HttpMethod

    }

    public Option<String> generate(String httpMethodStr, String url, Map<String, List<String>> parameters, AcHost acHost,
                                   Option<String> userId)
            throws JwtIssuerLacksSharedSecretException, JwtUnknownIssuerException, URISyntaxException {
        final HttpMethod method = HttpMethod.valueOf(httpMethodStr);

        final URI uri = new URI(url);
        final String path = uri.getPath();
        final URI baseUrl = new URI(acHost.getBaseUrl());
        final String productContext = baseUrl.getPath();
View Full Code Here

Examples of com.britesnow.snow.web.HttpMethod

   
    public WebRestRef getWebRestRef(RequestContext rc,String resourcePath){
        if (resourcePath == null){
            resourcePath = rc.getResourcePath();
        }
        HttpMethod method = rc.getMethod();
       
        WebRestRef ref = null;
        // first, check if there is a perfect match.
        Map<String,WebRestRef> refByPath = getRefByPath(method);
        if (refByPath != null){
View Full Code Here

Examples of com.cloudcontrolled.api.common.HttpMethod

    }

    Class<?> clazz = request.getClass();

    Method method = clazz.getAnnotation(Method.class);
    HttpMethod httpMethod = method.value();
    return httpMethod;
  }
View Full Code Here

Examples of com.dotcms.repackage.org.apache.commons.httpclient.HttpMethod

      String location, Cookie[] cookies, boolean post)
    throws IOException {

    byte[] byteArray = null;

    HttpMethod method = null;

    try {
      HttpClient client =
        new HttpClient(new SimpleHttpConnectionManager());

      if (location == null) {
        return byteArray;
      }
      else if (!location.startsWith(HTTP_WITH_SLASH) &&
           !location.startsWith(HTTPS_WITH_SLASH)) {

        location = HTTP_WITH_SLASH + location;
      }

      HostConfiguration hostConfig = new HostConfiguration();

      hostConfig.setHost(new URI(location));

      if (Validator.isNotNull(PROXY_HOST) && PROXY_PORT > 0) {
        hostConfig.setProxy(PROXY_HOST, PROXY_PORT);
      }

      client.setHostConfiguration(hostConfig);
      client.setConnectionTimeout(5000);
      client.setTimeout(5000);

      if (cookies != null && cookies.length > 0) {
        HttpState state = new HttpState();

        state.addCookies(cookies);
        state.setCookiePolicy(CookiePolicy.COMPATIBILITY);

        client.setState(state);
      }

      if (post) {
        method = new PostMethod(location);
      }
      else {
        method = new GetMethod(location);
      }

      method.setFollowRedirects(true);

      client.executeMethod(method);

      Header locationHeader = method.getResponseHeader("location");
      if (locationHeader != null) {
        return URLtoByteArray(locationHeader.getValue(), cookies, post);
      }

      InputStream is = method.getResponseBodyAsStream();

      if (is != null) {
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        byte[] bytes = new byte[512];

        for (int i = is.read(bytes, 0, 512); i != -1;
            i = is.read(bytes, 0, 512)) {

          buffer.write(bytes, 0, i);
        }

        byteArray = buffer.toByteArray();

        is.close();
        buffer.close();
      }

      return byteArray;
    }
    finally {
      try {
        if (method != null) {
          method.releaseConnection();
        }
      }
      catch (Exception e) {
        Logger.error(Http.class,e.getMessage(),e);
      }
View Full Code Here

Examples of com.dottydingo.hyperion.service.context.HttpMethod

        phaseContext.setEntityPlugin(plugin);

        phaseContext.setRequestMethod(getHttpMethod(request.getRequestMethod()));
        String requestMethod = getEffectiveMethod(request);
        HttpMethod httpMethod = getHttpMethod(requestMethod);

        if(!plugin.isMethodAllowed(httpMethod))
            throw new NotAllowedException(String.format("%s is not allowed.",httpMethod));

        if(serviceStatus.getReadOnly() && httpMethod.isWriteOperation())
            throw new NotAllowedException("Service is in read only mode.");

        phaseContext.setEffectiveMethod(httpMethod);

        // special case where version is in the URI
View Full Code Here

Examples of com.eviware.soapui.impl.rest.RestRequestInterface.HttpMethod

    private MockOperation findMatchedOperation(String pathToFind, HttpMethod verbToFind, boolean includePartialMatch) {
        MockOperation bestMatchedOperation = null;

        for (MockOperation operation : getMockOperationList()) {
            String operationPath = ((RestMockAction) operation).getResourcePath();
            HttpMethod operationVerb = ((RestMockAction) operation).getMethod();

            boolean matchesPath = operationPath.equals(pathToFind);
            boolean matchesVerb = verbToFind == operationVerb;
            boolean matchesPathPartially = pathToFind.startsWith(operationPath);
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.netty.handler.codec.http.HttpMethod

        }
        if (charset == null) {
            throw new NullPointerException("charset");
        }
        this.request = request;
        HttpMethod method = request.getMethod();
        if (method.equals(HttpMethod.POST) || method.equals(HttpMethod.PUT) || method.equals(HttpMethod.PATCH)) {
            bodyToDecode = true;
        }
        this.charset = charset;
        this.factory = factory;
        // Fill default values
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.