Example usage for org.springframework.http HttpMethod PATCH

List of usage examples for org.springframework.http HttpMethod PATCH

Introduction

In this page you can find the example usage for org.springframework.http HttpMethod PATCH.

Prototype

HttpMethod PATCH

To view the source code for org.springframework.http HttpMethod PATCH.

Click Source Link

Usage

From source file:org.springframework.cloud.netflix.zuul.filters.route.support.ZuulProxyTestBase.java

@Test
public void patchOnSelfViaSimpleHostRoutingFilter() {
    assumeThat(supportsPatch(), is(true));

    this.routes.addRoute("/self/**", "http://localhost:" + this.port + "/local");
    this.endpoint.reset();

    ResponseEntity<String> result = new TestRestTemplate().exchange("http://localhost:" + this.port + "/self/1",
            HttpMethod.PATCH, new HttpEntity<>("TestPatch"), String.class);
    assertEquals(HttpStatus.OK, result.getStatusCode());
    assertEquals("Patched 1!", result.getBody());
}

From source file:org.springframework.web.reactive.function.server.RequestPredicates.java

/**
 * Return a {@code RequestPredicate} that matches if request's HTTP method is {@code PATCH}
 * and the given {@code pattern} matches against the request path.
 * @param pattern the path pattern to match against
 * @return a predicate that matches if the request method is PATCH and if the given pattern
 * matches against the request path//w  w  w  . jav  a 2  s.c o  m
 */
public static RequestPredicate PATCH(String pattern) {
    return method(HttpMethod.PATCH).and(path(pattern));
}