Class FormDataControllerImpl


  • @RestController
    public class FormDataControllerImpl
    extends Object
    The form data controller.

    In a WebFlux application, form data is accessed via ServerWebExchange.getFormData(). For this reason the controller can't implement the interface, because it's signature differs from this implementation.

    Author:
    Christian Bremer
    • Constructor Detail

      • FormDataControllerImpl

        public FormDataControllerImpl()
    • Method Detail

      • addOk

        @PostMapping(path="/api/oks",
                     produces="text/plain",
                     consumes="application/x-www-form-urlencoded")
        public reactor.core.publisher.Mono<String> addOk​(org.springframework.web.server.ServerWebExchange exchange)
        Post form data.
        Parameters:
        exchange - the exchange with the form data
        Returns:
        the result
      • upload

        @RequestMapping(path="/upload",
                        method=POST,
                        consumes="application/x-www-form-urlencoded",
                        produces="application/json")
        public reactor.core.publisher.Mono<Map<String,​Object>> upload​(@RequestHeader(name="x-ok-flag")
                                                                            String headerValue,
                                                                            @CookieValue(name="last")
                                                                            String lastValue,
                                                                            org.springframework.web.server.ServerWebExchange exchange)
        Upload mono.
        Parameters:
        headerValue - the header value
        lastValue - the last value
        exchange - the exchange with the form data
        Returns:
        the result