Java Code Examples for org.springframework.http.HttpMethod#POST

The following examples show how to use org.springframework.http.HttpMethod#POST . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private ServerWebExchange exchange(MultiValueMap<String, String> formData) {

		MockClientHttpRequest request = new MockClientHttpRequest(HttpMethod.POST, "/");

		new FormHttpMessageWriter().write(Mono.just(formData),
				forClassWithGenerics(MultiValueMap.class, String.class, String.class),
				MediaType.APPLICATION_FORM_URLENCODED, request, Collections.emptyMap()).block();

		return MockServerWebExchange.from(
				MockServerHttpRequest
						.post("/")
						.contentType(MediaType.APPLICATION_FORM_URLENCODED)
						.body(request.getBody()));
	}
 
Example 2
@Override
public HttpMethod getHttpMethod() {
    return HttpMethod.POST;
}
 
Example 3
@Override
public HttpMethod getHttpMethod() {
    return HttpMethod.POST;
}
 
Example 4
Source Project: MicroCommunity   File: SaveUnitListener.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public HttpMethod getHttpMethod() {
    return HttpMethod.POST;
}
 
Example 5
@Override
public HttpMethod getHttpMethod() {
    return HttpMethod.POST;
}
 
Example 6
@Override
public HttpMethod getHttpMethod() {
    return HttpMethod.POST;
}
 
Example 7
@Override
public HttpMethod getHttpMethod() {
    return HttpMethod.POST;
}
 
Example 8
@Override
public HttpMethod getHttpMethod() {
    return HttpMethod.POST;
}
 
Example 9
private OperationRequest requestPostWithXmlContentType() {
	return new OperationRequest() {

		@Override
		public byte[] getContent() {
			String content = "<name>foo</name>";
			return content.getBytes(Charset.forName("UTF-8"));
		}

		@Override
		public String getContentAsString() {
			return "<name>foo</name>";
		}

		@Override
		public HttpHeaders getHeaders() {
			HttpHeaders httpHeaders = new HttpHeaders();
			httpHeaders.add("Content-Type", MediaType.APPLICATION_XML_VALUE);
			return httpHeaders;
		}

		@Override
		public HttpMethod getMethod() {
			return HttpMethod.POST;
		}

		@Override
		public Parameters getParameters() {
			return null;
		}

		@Override
		public Collection<OperationRequestPart> getParts() {
			return null;
		}

		@Override
		public URI getUri() {
			return URI.create("https://foo/bar");
		}

		@Override
		public Collection<RequestCookie> getCookies() {
			return Collections.emptySet();
		}
	};
}
 
Example 10
@Override
public HttpMethod getHttpMethod() {
    return HttpMethod.POST;
}
 
Example 11
@Override
public HttpMethod getHttpMethod() {
    return HttpMethod.POST;
}
 
Example 12
@Override
public HttpMethod getHttpMethod() {
    return HttpMethod.POST;
}
 
Example 13
@Override
public HttpMethod getHttpMethod() {
    return HttpMethod.POST;
}
 
Example 14
@Override
public HttpMethod getHttpMethod() {
    return HttpMethod.POST;
}
 
Example 15
@Override
public HttpMethod getHttpMethod() {
    return HttpMethod.POST;
}
 
Example 16
@Override
public HttpMethod getHttpMethod() {
    return HttpMethod.POST;
}
 
Example 17
@Override
public HttpMethod getHttpMethod() {
    return HttpMethod.POST;
}
 
Example 18
@Override
public HttpMethod getHttpMethod() {
    return HttpMethod.POST;
}
 
Example 19
@Override
public HttpMethod getHttpMethod() {
    return HttpMethod.POST;
}
 
Example 20
/**
 * Create a {@link MockHttpServletRequestBuilder} for a POST request.
 * @param uri the URL
 * @since 4.0.3
 */
public static MockHttpServletRequestBuilder post(URI uri) {
	return new MockHttpServletRequestBuilder(HttpMethod.POST, uri);
}