类 ReactorNetty2ClientHttpRequest
java.lang.Object
cn.taketoday.http.client.reactive.AbstractClientHttpRequest
cn.taketoday.http.client.reactive.ReactorNetty2ClientHttpRequest
class ReactorNetty2ClientHttpRequest
extends AbstractClientHttpRequest
implements ZeroCopyHttpOutputMessage
ClientHttpRequest implementation for the Reactor Netty 2 (Netty 5) HTTP client.
This class is based on ReactorClientHttpRequest.
- 从以下版本开始:
- 4.0
- 作者:
- Violeta Georgieva, Harry Yang
- 另请参阅:
-
HttpClient
-
字段概要
字段修饰符和类型字段说明private final cn.taketoday.core.io.buffer.Netty5DataBufferFactoryprivate final HttpMethodprivate final reactor.netty5.NettyOutboundprivate final reactor.netty5.http.client.HttpClientRequestprivate final URI -
构造器概要
构造器构造器说明ReactorNetty2ClientHttpRequest(HttpMethod method, URI uri, reactor.netty5.http.client.HttpClientRequest request, reactor.netty5.NettyOutbound outbound) -
方法概要
修饰符和类型方法说明protected voidAdd cookies fromAbstractClientHttpRequest.getHeaders()to the underlying request.protected voidApply header changes fromAbstractClientHttpRequest.getHeaders()to the underlying request.cn.taketoday.core.io.buffer.DataBufferFactoryReturn aDataBufferFactorythat can be used to create the body.Return the HTTP method of the request.<T> TReturn the request from the underlying HTTP library.getURI()Return the URI of the request.protected HttpHeadersInitialize the read-only headers after the request is committed.reactor.core.publisher.Mono<Void>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).private static org.reactivestreams.Publisher<io.netty5.buffer.Buffer>toBuffers(org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer> dataBuffers) reactor.core.publisher.Mono<Void>writeAndFlushWith(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer>> body) Use the givenPublisherofPublishersto write the body of the HttpOutputMessage to the underlying HTTP layer, flushing after eachPublisher<DataBuffer>.reactor.core.publisher.Mono<Void>Use the givenPathto write the body of the message to the underlying HTTP layer.reactor.core.publisher.Mono<Void>writeWith(org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer> body) Use the givenPublisherto write the body of the message to the underlying HTTP layer.从类继承的方法 cn.taketoday.http.client.reactive.AbstractClientHttpRequest
beforeCommit, doCommit, doCommit, getCookies, getHeaders, isCommitted从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.http.HttpMessage
getHeaders从接口继承的方法 cn.taketoday.http.ReactiveHttpOutputMessage
beforeCommit, isCommitted从接口继承的方法 cn.taketoday.http.ZeroCopyHttpOutputMessage
writeWith
-
字段详细资料
-
httpMethod
-
uri
-
request
private final reactor.netty5.http.client.HttpClientRequest request -
outbound
private final reactor.netty5.NettyOutbound outbound -
bufferFactory
private final cn.taketoday.core.io.buffer.Netty5DataBufferFactory bufferFactory
-
-
构造器详细资料
-
ReactorNetty2ClientHttpRequest
public ReactorNetty2ClientHttpRequest(HttpMethod method, URI uri, reactor.netty5.http.client.HttpClientRequest request, reactor.netty5.NettyOutbound outbound)
-
-
方法详细资料
-
getMethod
从接口复制的说明:ClientHttpRequestReturn the HTTP method of the request.- 指定者:
getMethod在接口中ClientHttpRequest
-
getURI
从接口复制的说明:ClientHttpRequestReturn the URI of the request.- 指定者:
getURI在接口中ClientHttpRequest
-
bufferFactory
public cn.taketoday.core.io.buffer.DataBufferFactory bufferFactory()从接口复制的说明:ReactiveHttpOutputMessageReturn aDataBufferFactorythat can be used to create the body.- 指定者:
bufferFactory在接口中ReactiveHttpOutputMessage- 返回:
- a buffer factory
- 另请参阅:
-
getNativeRequest
public <T> T getNativeRequest()从接口复制的说明:ClientHttpRequestReturn the request from the underlying HTTP library.- 指定者:
getNativeRequest在接口中ClientHttpRequest- 类型参数:
T- the expected type of the request to cast to
-
writeWith
public reactor.core.publisher.Mono<Void> writeWith(org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer> body) 从接口复制的说明:ReactiveHttpOutputMessageUse the givenPublisherto write the body of the message to the underlying HTTP layer.- 指定者:
writeWith在接口中ReactiveHttpOutputMessage- 参数:
body- the body content publisher- 返回:
- a
Monothat indicates completion or error
-
writeAndFlushWith
public reactor.core.publisher.Mono<Void> writeAndFlushWith(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer>> body) 从接口复制的说明:ReactiveHttpOutputMessageUse the givenPublisherofPublishersto write the body of the HttpOutputMessage to the underlying HTTP layer, flushing after eachPublisher<DataBuffer>.- 指定者:
writeAndFlushWith在接口中ReactiveHttpOutputMessage- 参数:
body- the body content publisher- 返回:
- a
Monothat indicates completion or error
-
toBuffers
private static org.reactivestreams.Publisher<io.netty5.buffer.Buffer> toBuffers(org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer> dataBuffers) -
writeWith
从接口复制的说明:ZeroCopyHttpOutputMessageUse the givenPathto write the body of the message to the underlying HTTP layer.- 指定者:
writeWith在接口中ZeroCopyHttpOutputMessage- 参数:
file- the file to transferposition- the position within the file from which the transfer is to begincount- the number of bytes to be transferred- 返回:
- a publisher that indicates completion or error.
-
setComplete
从接口复制的说明:ReactiveHttpOutputMessageIndicate 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
Monothat indicates completion or error
-
applyHeaders
protected void applyHeaders()从类复制的说明:AbstractClientHttpRequestApply header changes fromAbstractClientHttpRequest.getHeaders()to the underlying request. This method is called once only.- 指定者:
applyHeaders在类中AbstractClientHttpRequest
-
applyCookies
protected void applyCookies()从类复制的说明:AbstractClientHttpRequestAdd cookies fromAbstractClientHttpRequest.getHeaders()to the underlying request. This method is called once only.- 指定者:
applyCookies在类中AbstractClientHttpRequest
-
initReadOnlyHeaders
从类复制的说明:AbstractClientHttpRequestInitialize the read-only headers after the request is committed.By default, this method simply applies a read-only wrapper. Subclasses can do the same for headers from the native request.
-