Java Code Examples for io.vertx.core.http.HttpMethod.POST

The following are Jave code examples for showing how to use POST of the io.vertx.core.http.HttpMethod class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: app-ms   File: JaxRsRouter.java   View Source Code Vote up 5 votes
/**
 * Gets the {@link HttpMethod} based on the annotation associated with the
 * method. Only GET, POST, PUT, DELETE are supported.
 *
 * @param m
 *            method
 * @return {@link HttpMethod}
 */
private HttpMethod getHttpMethod(final Method m) {

    if (m.getAnnotation(GET.class) != null) {
        return HttpMethod.GET;
    } else if (m.getAnnotation(POST.class) != null) {
        return HttpMethod.POST;
    } else if (m.getAnnotation(PUT.class) != null) {
        return HttpMethod.PUT;
    } else if (m.getAnnotation(DELETE.class) != null) {
        return HttpMethod.DELETE;
    } else {
        throw new IllegalStateException("Unabel to determine HTTP Method");
    }
}
 
Example 2
Project: app-ms   File: PathPlaceholderTest.java   View Source Code Vote up 5 votes
@Test
public void testExact() {

    final JaxRsPath path = new JaxRsPath("/exact", new String[0], new String[0], HttpMethod.POST);
    assertTrue(path.isExact());
    assertEquals(path.getPath(), path.getPathRegex());
}
 
Example 3
Project: app-ms   File: PathPlaceholderTest.java   View Source Code Vote up 5 votes
@Test
public void testSimplePlaceholder() {

    final JaxRsPath path = new JaxRsPath("/exact/{id}", new String[0], new String[0], HttpMethod.POST);
    assertFalse(path.isExact());
    assertEquals("/exact/[^/]+", path.getPathRegex());
}
 
Example 4
Project: app-ms   File: PathPlaceholderTest.java   View Source Code Vote up 5 votes
@Test
public void testSimplePlaceholder2() {

    final JaxRsPath path = new JaxRsPath("/exact/{id}/foo", new String[0], new String[0], HttpMethod.POST);
    assertFalse(path.isExact());
    assertEquals("/exact/[^/]+/foo", path.getPathRegex());
}