pavlenkodev commented on issue #10378: URL: https://github.com/apache/apisix/issues/10378#issuecomment-1845980771
Hello, @shreemaan-abhishek ! I used this feature in the rewrite phase. She's right for me. I did something similar to https://github.com/bzp2010/apisix-plugin-pipeline-request/blob/main/apisix/plugins/pipeline-request.lua ``` return function(conf, ctx) local http = require("socket.http") local ltn12 = require("ltn12") local core = require("apisix.core") local validator_url = "https://MY-VALIDATOR-SERVICE" local eceiver_url = "https://MY-RECEIVER-SERVICE" local request_method = "POST" local headers_values = core.request.headers() local body_values = core.request.get_body() local response_body = {} local validator_result, validator_response_code, validator_response_headers = http.request { method = request_method, url = validator_url, source = ltn12.source.string(body_values), headers = headers_values, sink = ltn12.sink.table(response_body) } if validator_response_code == 200 then response_body = {} local receiver_result, receiver_response_code, receiver_response_headers = http.request { method = request_method, url = receiver_url, source = ltn12.source.string(body_values), headers = headers_values, sink = ltn12.sink.table(response_body) } response_body = table.concat(response_body) return receiver_response_code, response_body end response_body = table.concat(response_body) return validator_response_code, response_body end ``` > @pavlenkodev please share what worked for you I want to learn how you made it through. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
