Example usage for org.springframework.web.reactive.function.server ServerResponse writeTo

List of usage examples for org.springframework.web.reactive.function.server ServerResponse writeTo

Introduction

In this page you can find the example usage for org.springframework.web.reactive.function.server ServerResponse writeTo.

Prototype

Mono<Void> writeTo(ServerWebExchange exchange, Context context);

Source Link

Document

Write this response to the given web exchange.

Usage

From source file:org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler.java

private Mono<? extends Void> write(ServerWebExchange exchange, ServerResponse response) {
    // force content-type since writeTo won't overwrite response header values
    exchange.getResponse().getHeaders().setContentType(response.headers().getContentType());
    return response.writeTo(exchange, new ResponseContext());
}