接口 ClientRequest.Builder

    • 方法详细资料

      • url

        ClientRequest.Builder url​(URI url)
        Set the url of the request.
        参数:
        url - the new url
        返回:
        this builder
        从以下版本开始:
        5.0.1
      • headers

        ClientRequest.Builder headers​(Consumer<HttpHeaders> headersConsumer)
        Manipulate this request's headers with the given consumer. The headers provided to the consumer are "live", so that the consumer can be used to overwrite existing header values, remove values, or use any of the other HttpHeaders methods.
        参数:
        headersConsumer - a function that consumes the HttpHeaders
        返回:
        this builder
      • body

        <S,​P extends org.reactivestreams.Publisher<S>> ClientRequest.Builder body​(P publisher,
                                                                                        Class<S> elementClass)
        Set the body of the request to the given Publisher and return it.
        类型参数:
        S - the type of the elements contained in the publisher
        P - the type of the Publisher
        参数:
        publisher - the Publisher to write to the request
        elementClass - the class of elements contained in the publisher
        返回:
        the built request
      • body

        <S,​P extends org.reactivestreams.Publisher<S>> ClientRequest.Builder body​(P publisher,
                                                                                        ParameterizedTypeReference<S> typeReference)
        Set the body of the request to the given Publisher and return it.
        类型参数:
        S - the type of the elements contained in the publisher
        P - the type of the Publisher
        参数:
        publisher - the Publisher to write to the request
        typeReference - a type reference describing the elements contained in the publisher
        返回:
        the built request
      • attribute

        ClientRequest.Builder attribute​(String name,
                                        Object value)
        Set the attribute with the given name to the given value.
        参数:
        name - the name of the attribute to add
        value - the value of the attribute to add
        返回:
        this builder
      • attributes

        ClientRequest.Builder attributes​(Consumer<Map<String,​Object>> attributesConsumer)
        Manipulate the request attributes with the given consumer. The attributes provided to the consumer are "live", so that the consumer can be used to inspect attributes, remove attributes, or use any of the other map-provided methods.
        参数:
        attributesConsumer - a function that consumes the attributes
        返回:
        this builder