类 ClientHttpRequestDecorator
- java.lang.Object
- org.springframework.http.client.reactive.ClientHttpRequestDecorator
public class ClientHttpRequestDecorator extends Object implements ClientHttpRequest
Wraps anotherClientHttpRequest
and delegates all methods to it. Sub-classes can override specific methods selectively.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 ClientHttpRequestDecorator(ClientHttpRequest delegate)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
beforeCommit(Supplier<? extends reactor.core.publisher.Mono<Void>> action)
Register an action to apply just before the HttpOutputMessage is committed.DataBufferFactory
bufferFactory()
Return aDataBufferFactory
that can be used to create the body.MultiValueMap<String,HttpCookie>
getCookies()
Return a mutable map of request cookies to send to the server.ClientHttpRequest
getDelegate()
HttpHeaders
getHeaders()
Return the headers of this message.HttpMethod
getMethod()
Return the HTTP method of the request.URI
getURI()
Return the URI of the request.boolean
isCommitted()
Whether the HttpOutputMessage is committed.reactor.core.publisher.Mono<Void>
setComplete()
Indicate that message handling is complete, allowing for any cleanup or end-of-processing tasks to be performed such as applying header changes made viaHttpMessage.getHeaders()
to the underlying HTTP message (if not applied already).String
toString()
reactor.core.publisher.Mono<Void>
writeAndFlushWith(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends DataBuffer>> body)
Use the givenPublisher
ofPublishers
to write the body of the HttpOutputMessage to the underlying HTTP layer, flushing after eachPublisher<DataBuffer>
.reactor.core.publisher.Mono<Void>
writeWith(org.reactivestreams.Publisher<? extends DataBuffer> body)
Use the givenPublisher
to write the body of the message to the underlying HTTP layer.
构造器详细资料
ClientHttpRequestDecorator
public ClientHttpRequestDecorator(ClientHttpRequest delegate)
方法详细资料
getDelegate
public ClientHttpRequest getDelegate()
getMethod
public HttpMethod getMethod()
从接口复制的说明:ClientHttpRequest
Return the HTTP method of the request.- 指定者:
getMethod
在接口中ClientHttpRequest
getURI
public URI getURI()
从接口复制的说明:ClientHttpRequest
Return the URI of the request.- 指定者:
getURI
在接口中ClientHttpRequest
getHeaders
public HttpHeaders getHeaders()
从接口复制的说明:HttpMessage
Return the headers of this message.- 指定者:
getHeaders
在接口中HttpMessage
- 返回:
- a corresponding HttpHeaders object (never
null
)
getCookies
public MultiValueMap<String,HttpCookie> getCookies()
从接口复制的说明:ClientHttpRequest
Return a mutable map of request cookies to send to the server.- 指定者:
getCookies
在接口中ClientHttpRequest
bufferFactory
public DataBufferFactory bufferFactory()
从接口复制的说明:ReactiveHttpOutputMessage
Return aDataBufferFactory
that can be used to create the body.- 指定者:
bufferFactory
在接口中ReactiveHttpOutputMessage
- 返回:
- a buffer factory
- 另请参阅:
ReactiveHttpOutputMessage.writeWith(Publisher)
beforeCommit
public void beforeCommit(Supplier<? extends reactor.core.publisher.Mono<Void>> action)
从接口复制的说明:ReactiveHttpOutputMessage
Register an action to apply just before the HttpOutputMessage is committed.Note: the supplied action must be properly deferred, e.g. via
Mono.defer(java.util.function.Supplier<? extends reactor.core.publisher.Mono<? extends T>>)
orMono.fromRunnable(java.lang.Runnable)
, to ensure it's executed in the right order, relative to other actions.- 指定者:
beforeCommit
在接口中ReactiveHttpOutputMessage
- 参数:
action
- the action to apply
isCommitted
public boolean isCommitted()
从接口复制的说明:ReactiveHttpOutputMessage
Whether the HttpOutputMessage is committed.- 指定者:
isCommitted
在接口中ReactiveHttpOutputMessage
writeWith
public reactor.core.publisher.Mono<Void> writeWith(org.reactivestreams.Publisher<? extends DataBuffer> body)
从接口复制的说明:ReactiveHttpOutputMessage
Use the givenPublisher
to write the body of the message to the underlying HTTP layer.- 指定者:
writeWith
在接口中ReactiveHttpOutputMessage
- 参数:
body
- the body content publisher- 返回:
- a
Mono
that indicates completion or error
writeAndFlushWith
public reactor.core.publisher.Mono<Void> writeAndFlushWith(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends DataBuffer>> body)
从接口复制的说明:ReactiveHttpOutputMessage
Use the givenPublisher
ofPublishers
to write the body of the HttpOutputMessage to the underlying HTTP layer, flushing after eachPublisher<DataBuffer>
.- 指定者:
writeAndFlushWith
在接口中ReactiveHttpOutputMessage
- 参数:
body
- the body content publisher- 返回:
- a
Mono
that indicates completion or error
setComplete
public reactor.core.publisher.Mono<Void> setComplete()
从接口复制的说明:ReactiveHttpOutputMessage
Indicate that message handling is complete, allowing for any cleanup or end-of-processing tasks to be performed such as applying header changes made viaHttpMessage.getHeaders()
to the underlying HTTP message (if not applied already).This method should be automatically invoked at the end of message processing so typically applications should not have to invoke it. If invoked multiple times it should have no side effects.
- 指定者:
setComplete
在接口中ReactiveHttpOutputMessage
- 返回:
- a
Mono
that indicates completion or error