类 ResponseUtils
java.lang.Object
org.apache.shenyu.plugin.base.utils.ResponseUtils
ResponseUtils.
-
方法概要
修饰符和类型方法说明static org.springframework.web.reactive.function.client.ClientResponsebuildClientResponse(org.springframework.http.server.reactive.ServerHttpResponse response, org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer> body) build client response with current response data.static org.springframework.http.HttpHeaderschunkedHeader(org.springframework.http.HttpHeaders headers) Chunked Headers.static reactor.core.publisher.Mono<org.springframework.core.io.buffer.DataBuffer>fixBodyMessage(org.springframework.http.server.reactive.ServerHttpResponse response, CachedBodyOutputMessage outputMessage) fix the body message.static CachedBodyOutputMessagenewCachedBodyOutputMessage(org.springframework.web.server.ServerWebExchange exchange) create CachedBodyOutputMessage.static <T> reactor.core.publisher.Mono<T>release(CachedBodyOutputMessage outputMessage, Throwable throwable) release source.static <T,P extends org.reactivestreams.Publisher<T>>
reactor.core.publisher.Mono<Void>writeWith(org.springframework.web.reactive.function.client.ClientResponse clientResponse, org.springframework.web.server.ServerWebExchange exchange, P publisher, Class<T> elementClass) the response write with data.
-
方法详细资料
-
newCachedBodyOutputMessage
public static CachedBodyOutputMessage newCachedBodyOutputMessage(org.springframework.web.server.ServerWebExchange exchange) create CachedBodyOutputMessage.- 参数:
exchange- ServerWebExchange- 返回:
- CachedBodyOutputMessage.
-
buildClientResponse
public static org.springframework.web.reactive.function.client.ClientResponse buildClientResponse(org.springframework.http.server.reactive.ServerHttpResponse response, org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer> body) build client response with current response data.- 参数:
response- current responsebody- current response body- 返回:
- the client response
-
fixBodyMessage
public static reactor.core.publisher.Mono<org.springframework.core.io.buffer.DataBuffer> fixBodyMessage(org.springframework.http.server.reactive.ServerHttpResponse response, CachedBodyOutputMessage outputMessage) fix the body message.- 参数:
response- current responseoutputMessage- cache message- 返回:
- fixed body message
-
release
public static <T> reactor.core.publisher.Mono<T> release(CachedBodyOutputMessage outputMessage, Throwable throwable) release source.- 类型参数:
T- the reifiedSubscribertype- 参数:
outputMessage- CachedBodyOutputMessagethrowable- Throwable- 返回:
- Mono.
-
chunkedHeader
public static org.springframework.http.HttpHeaders chunkedHeader(org.springframework.http.HttpHeaders headers) Chunked Headers.- 参数:
headers- headers.- 返回:
- chunked headers
-
writeWith
public static <T,P extends org.reactivestreams.Publisher<T>> reactor.core.publisher.Mono<Void> writeWith(org.springframework.web.reactive.function.client.ClientResponse clientResponse, org.springframework.web.server.ServerWebExchange exchange, P publisher, Class<T> elementClass) the response write with data.- 类型参数:
T- the element typeP- the publishing type- 参数:
clientResponse- the client responseexchange- the exchangepublisher- the publisherelementClass- the elementClass- 返回:
- the response wrapper data
-