public void postFilter()

in sample/src/main/java/org/apache/apisix/plugin/runner/filter/ResponseFilter.java [36:50]


    public void postFilter(PostRequest request, PostResponse response, PluginFilterChain chain) {
        String configStr = request.getConfig(this);
        Gson gson = new Gson();
        Map<String, Object> conf = new HashMap<>();
        conf = gson.fromJson(configStr, conf.getClass());

        Map<String, String> headers = request.getUpstreamHeaders();
        String contentType = headers.get("Content-Type");
        Integer upstreamStatusCode = request.getUpstreamStatusCode();

        response.setStatusCode(Double.valueOf(conf.get("response_code").toString()).intValue());
        response.setBody((String) conf.get("response_body"));
        response.setHeader((String) conf.get("response_header_name"), (String) conf.get("response_header_value"));
        chain.postFilter(request, response);
    }