Java 类org.springframework.web.util.UriBuilder 实例源码

项目:reactive-ms-example    文件:BasicIntegrationTest.java   
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());
}
项目:reactive-ms-example    文件:BasicIntegrationTest.java   
protected <T> T get(final Function<UriBuilder, URI> builder, final HttpStatus status, final Class<T> type) {
    return client.get()
            .uri(builder)
            .accept(APPLICATION_JSON_UTF8).exchange()
            .expectStatus().isEqualTo(status)
            .expectHeader().contentType(APPLICATION_JSON_UTF8)
            .expectBody(type)
            .returnResult().getResponseBody();
}
项目:reactive-ms-example    文件:BasicIntegrationTest.java   
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();
}
项目:spring-webflux-client    文件:DefaultRequest.java   
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);
}
项目:spring-vault    文件:VaultClients.java   
@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);
}
项目:spring-webflux-client    文件:DefaultRequest.java   
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);
}
项目:reactive-ms-example    文件:BasicIntegrationTest.java   
protected String get(final Function<UriBuilder, URI> builder) {
    return get(builder, HttpStatus.OK);
}
项目:reactive-ms-example    文件:BasicIntegrationTest.java   
protected <T> T get(final Function<UriBuilder, URI> builder, final Class<T> type) {
    return get(builder, HttpStatus.OK, type);
}
项目:reactive-ms-example    文件:BasicIntegrationTest.java   
protected <T, K> T post(final Function<UriBuilder, URI> builder, final K object, final Class<T> type) {
    return post(builder, HttpStatus.OK, object, type);
}
项目:spring-webflux-client    文件:DefaultRequestTest.java   
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());
}
项目:spring-webflux-client    文件:DefaultRequestTest.java   
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());
}