类 AbstractClientHttpRequest
- java.lang.Object
- org.springframework.http.client.reactive.AbstractClientHttpRequest
- 直接已知子类:
MockClientHttpRequest
public abstract class AbstractClientHttpRequest extends Object implements ClientHttpRequest
Base class forClientHttpRequest
implementations.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev, Brian Clozel
构造器概要
构造器 构造器 说明 AbstractClientHttpRequest()
AbstractClientHttpRequest(HttpHeaders headers)
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected abstract void
applyCookies()
Add cookies fromgetHeaders()
to the underlying request.protected abstract void
applyHeaders()
Apply header changes fromgetHeaders()
to the underlying request.void
beforeCommit(Supplier<? extends reactor.core.publisher.Mono<Void>> action)
Register an action to apply just before the HttpOutputMessage is committed.protected reactor.core.publisher.Mono<Void>
doCommit()
A variant ofdoCommit(Supplier)
for a request without body.protected reactor.core.publisher.Mono<Void>
doCommit(Supplier<? extends org.reactivestreams.Publisher<Void>> writeAction)
ApplybeforeCommit
actions, apply the request headers/cookies, and write the request body.MultiValueMap<String,HttpCookie>
getCookies()
Return a mutable map of request cookies to send to the server.HttpHeaders
getHeaders()
Return the headers of this message.boolean
isCommitted()
Whether the HttpOutputMessage is committed.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.http.client.reactive.ClientHttpRequest
getMethod, getURI
从接口继承的方法 org.springframework.http.ReactiveHttpOutputMessage
bufferFactory, setComplete, writeAndFlushWith, writeWith
构造器详细资料
AbstractClientHttpRequest
public AbstractClientHttpRequest()
AbstractClientHttpRequest
public AbstractClientHttpRequest(HttpHeaders headers)
方法详细资料
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
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
doCommit
protected reactor.core.publisher.Mono<Void> doCommit()
A variant ofdoCommit(Supplier)
for a request without body.- 返回:
- a completion publisher
doCommit
protected reactor.core.publisher.Mono<Void> doCommit(@Nullable Supplier<? extends org.reactivestreams.Publisher<Void>> writeAction)
ApplybeforeCommit
actions, apply the request headers/cookies, and write the request body.- 参数:
writeAction
- the action to write the request body (may benull
)- 返回:
- a completion publisher
applyHeaders
protected abstract void applyHeaders()
Apply header changes fromgetHeaders()
to the underlying request. This method is called once only.
applyCookies
protected abstract void applyCookies()
Add cookies fromgetHeaders()
to the underlying request. This method is called once only.