Spring boot 如何使用zuul过滤器在post请求中发送请求数据

Spring boot 如何使用zuul过滤器在post请求中发送请求数据,spring-boot,netflix-zuul,Spring Boot,Netflix Zuul,我是Zuul的新手,我想在spring boot应用程序中使用Zuul预过滤器重定向到外部url。我想发送请求数据以调用外部url(python中的post方法api)。 当我尝试使用下面的代码发送请求数据时,当我点击来自postman的url时,我得到405该方法不允许用于请求的url 我的代码: RequestContext ctx = RequestContext.getCurrentContext(); HttpServletRequest request = ctx.getReques

我是Zuul的新手,我想在spring boot应用程序中使用Zuul预过滤器重定向到外部url。我想发送请求数据以调用外部url(python中的post方法api)。 当我尝试使用下面的代码发送请求数据时,当我点击来自postman的url时,我得到405该方法不允许用于请求的url

我的代码:

RequestContext ctx = RequestContext.getCurrentContext();
HttpServletRequest request = ctx.getRequest();
InputStream in = request.getInputStream();
String body = StreamUtils.copyToString(in, Charset.forName("UTF-8"));
ctx.set(body);
当我点击url时,就像http://localhost:8080/customers/ 通过postman中的请求体,它应该通过发送post数据重定向到外部url(api方法),但我得到405该方法不允许用于请求的url


有谁能帮我解决这个问题吗?我想在zuul中发送请求数据并调用外部api。谢谢你

你能在github里放一台复制机吗?你能在github里放一台复制机吗?