当前位置: 首页>>代码示例>>Java>>正文


Java UriBuilder类代码示例

本文整理汇总了Java中org.springframework.web.util.UriBuilder的典型用法代码示例。如果您正苦于以下问题:Java UriBuilder类的具体用法?Java UriBuilder怎么用?Java UriBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


UriBuilder类属于org.springframework.web.util包,在下文中一共展示了UriBuilder类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: get

import org.springframework.web.util.UriBuilder; //导入依赖的package包/类
private String get(final Function<UriBuilder, URI> builder, final HttpStatus status) {
    return new String(client.get()
            .uri(builder)
            .accept(TEXT_HTML).exchange()
            .expectStatus().isEqualTo(status)
            .expectHeader().contentType(TEXT_HTML)
            .expectBody().returnResult().getResponseBody());
}
 
开发者ID:LearningByExample,项目名称:reactive-ms-example,代码行数:9,代码来源:BasicIntegrationTest.java

示例2: post

import org.springframework.web.util.UriBuilder; //导入依赖的package包/类
protected <T, K> T post(final Function<UriBuilder, URI> builder, final HttpStatus status, final K object, final Class<T> type) {
    return client.post()
            .uri(builder)
            .body(BodyInserters.fromObject(object))
            .accept(APPLICATION_JSON_UTF8).exchange()
            .expectStatus().isEqualTo(status)
            .expectHeader().contentType(APPLICATION_JSON_UTF8)
            .expectBody(type)
            .returnResult().getResponseBody();
}
 
开发者ID:LearningByExample,项目名称:reactive-ms-example,代码行数:11,代码来源:BasicIntegrationTest.java

示例3: buildRequest

import org.springframework.web.util.UriBuilder; //导入依赖的package包/类
public DefaultRequest buildRequest(String uri, Map<String, Object> variables) {
    UriBuilder uriBuilder = new DefaultUriBuilderFactory(uri).builder();
    return new DefaultRequest(uriBuilder, HttpMethod.GET, new HttpHeaders(), variables, BodyInserters.empty());
}
 
开发者ID:jbrixhe,项目名称:spring-webflux-client,代码行数:5,代码来源:DefaultRequestTest.java

示例4: DefaultRequest

import org.springframework.web.util.UriBuilder; //导入依赖的package包/类
public DefaultRequest(UriBuilder uriBuilder,
                      HttpMethod httpMethod,
                      HttpHeaders httpHeaders,
                      Map<String, Object> variables,
                      BodyInserter<?, ? super ClientHttpRequest> bodyInserter) {

    this.uriBuilder = uriBuilder;
    this.httpMethod = httpMethod;
    this.bodyInserter = bodyInserter;
    this.variables = new HashMap<>();
    this.variables.putAll(variables);
    this.httpHeaders = new HttpHeaders();
    this.httpHeaders.putAll(httpHeaders);
}
 
开发者ID:jbrixhe,项目名称:spring-webflux-client,代码行数:15,代码来源:DefaultRequest.java

示例5: uriString

import org.springframework.web.util.UriBuilder; //导入依赖的package包/类
@Override
public UriBuilder uriString(String uriTemplate) {

	VaultEndpoint endpoint = endpointProvider.getVaultEndpoint();

	String baseUri = toBaseUri(endpoint);
	UriComponents uriComponents = UriComponentsBuilder.fromUriString(
			prepareUriTemplate(baseUri, uriTemplate)).build();

	return UriComponentsBuilder.fromUriString(baseUri).uriComponents(
			uriComponents);
}
 
开发者ID:spring-projects,项目名称:spring-vault,代码行数:13,代码来源:VaultClients.java


注:本文中的org.springframework.web.util.UriBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。