How to get response body in Zuul post filter?

前端 未结 6 1273
时光说笑
时光说笑 2021-01-04 06:55

How it is possible to read a response body while using Zuul as a proxy in post filter?

I am trying to call the code like this:

@Componen         


        
6条回答
  •  一个人的身影
    2021-01-04 07:39

    As you can see in this example, you have two methods available to extract the response body:

    1- ctx.getResponseBody();

    2- ctx.getResponseDataStream();

    You have to check which one is not null and use that one.

提交回复
热议问题