Package org.springframework.http

Examples of org.springframework.http.HttpMethod


        try {
            uri = new URI(request.getRequestLine().getUri());
        } catch (URISyntaxException e) {
            throw new RuntimeException(e);
        }
        HttpMethod method = HttpMethod.valueOf(request.getRequestLine().getMethod());

        final List<HttpProxy> proxies = config.getProxies();
        for (HttpProxy proxy : proxies) {
            try {
                if (proxy.matches(MatchInfo.fromUri(uri, method))) {
View Full Code Here


      logger.error("No TransportHandler for " + request.getURI());
      response.setStatusCode(HttpStatus.NOT_FOUND);
      return;
    }

    HttpMethod supportedMethod = transportType.getHttpMethod();
    if (!supportedMethod.equals(request.getMethod())) {
      if (HttpMethod.OPTIONS.equals(request.getMethod()) && transportType.supportsCors()) {
        if (checkAndAddCorsHeaders(request, response, HttpMethod.OPTIONS, supportedMethod)) {
          response.setStatusCode(HttpStatus.NO_CONTENT);
          addCacheHeaders(response);
        }
View Full Code Here

    request.execute();
  }

  @Test
  public void changeMethod() throws Exception {
    final HttpMethod changedMethod = HttpMethod.POST;
    ClientHttpRequestInterceptor interceptor = new ClientHttpRequestInterceptor() {
      @Override
      public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution)
          throws IOException {
View Full Code Here

    *
    * @param networkAdd
    */
   public void add(NetworkAdd networkAdd) {
      final String path = Constants.REST_PATH_NETWORKS;
      final HttpMethod httpverb = HttpMethod.POST;
      restClient.createObject(networkAdd, path, httpverb);
   }
View Full Code Here

    * @param networkAdd
    */
   public void increaseIPs(NetworkAdd networkAdd) {
      String networkName = CommonUtil.encode(networkAdd.getName());
      final String path = Constants.REST_PATH_NETWORK + "/" + networkName;
      final HttpMethod httpverb = HttpMethod.PUT;
      restClient.update(networkAdd, path, httpverb);
   }
View Full Code Here

    * @param name
    */
   public void delete(String name) {
      name = CommonUtil.encode(name);
      final String path = Constants.REST_PATH_NETWORK;
      final HttpMethod httpverb = HttpMethod.DELETE;
      restClient.deleteObject(name, path, httpverb);
   }
View Full Code Here

   /**
    * Find all network information.
    * @return  network list
    */
   public NetworkRead[] getAll(boolean detail) {
      final HttpMethod httpverb = HttpMethod.GET;
      String path = Constants.REST_PATH_NETWORKS;

      return restClient.getAllObjects(NetworkRead[].class, path, httpverb, detail);
   }
View Full Code Here

    * @return a network information
    */
   public NetworkRead get(String name, boolean detail) {
      name = CommonUtil.encode(name);
      final String path = Constants.REST_PATH_NETWORK;
      final HttpMethod httpverb = HttpMethod.GET;

      return restClient.getObject(name, NetworkRead.class, path, httpverb, detail);
   }
View Full Code Here

   @Autowired
   private RestClient restClient;
  
   public void add(DatastoreAdd datastoreAdd) {
      final String path = Constants.REST_PATH_DATASTORES;
      final HttpMethod httpverb = HttpMethod.POST;
     
      restClient.createObject(datastoreAdd, path, httpverb);
   }
View Full Code Here

   }

   public void delete(String id) {
      id = CommonUtil.encode(id);
      final String path = Constants.REST_PATH_DATASTORE;
      final HttpMethod httpverb = HttpMethod.DELETE;

      restClient.deleteObject(id, path, httpverb);
   }
View Full Code Here

TOP

Related Classes of org.springframework.http.HttpMethod

Copyright © 2018 www.massapicom. 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.