Java 在spring boot starter webflux中重定向到外部绝对URL而不使用视图解析程序

Java 在spring boot starter webflux中重定向到外部绝对URL而不使用视图解析程序,java,url-redirection,spring-webflux,Java,Url Redirection,Spring Webflux,我正在使用SpringWebFlux创建一个应用程序。我已经公开了一个控制器,它有一个方法是被动的,并返回一个Mono作为返回类型。 堆栈是反应性的。 请求在浏览器中发出,API将根据某种本质上异步的计算将浏览器中的用户重定向到url。现在我得到的不是重定向,而是如下所示的响应 有没有办法做到这一点 { "defaultCharset": "UTF-8", "requestContextAttribute": null, "beanName": null, "applicationContext

我正在使用SpringWebFlux创建一个应用程序。我已经公开了一个控制器,它有一个方法是被动的,并返回一个Mono作为返回类型。 堆栈是反应性的。 请求在浏览器中发出,API将根据某种本质上异步的计算将浏览器中的用户重定向到url。现在我得到的不是重定向,而是如下所示的响应

有没有办法做到这一点

{
"defaultCharset": "UTF-8",
"requestContextAttribute": null,
"beanName": null,
"applicationContext": null,
"url": "https://my.box.com/service/auth/oauth/authorize?client_id=3d58a6ae9da221193d688feb521cf3f78ab8f1e04b3110813798b6feb877aa4d&response_type=code&redirect_uri=https://memini.serveo.net/api/v1/sources/BOX/connection?state=79299a49-e716-4ac5-a4f1-d16a2fdf6de5",
"contextRelative": true,
"statusCode": "SEE_OTHER",
"propagateQuery": false,
"hosts": null,
"redirectView": true,
"supportedMediaTypes": [
{
"type": "text",
"subtype": "html",
"parameters": {
"charset": "UTF-8"
},
"qualityValue": 1,
"wildcardType": false,
"wildcardSubtype": false,
"charset": "UTF-8",
"concrete": true
}
]
}

我们使用下面的代码很好地实现了它

@GetMapping("/")
Mono<Void> redirect(ServerHttpResponse response) {
  response.setStatus(TEMPORARY_REDIRECT);
  response.getHeaders().setLocation(URI.create(authorizationUrl));
  return response.setComplete();
}