Description
1.upstream body may response:
{ "data": [], "total": 100 }
http status code: 200
then I want to rewrite it like :
{ "data":{ "data": [],"total": 100} , "errcode": 0 }
http status code: 200
2.upstream body may response:
"Internal error."
http status code: 500
then I want to rewrite it like :
{ "msg": "Internal error.", "errcode": 500, "data": null }
http status code: 200
I want to know how to do it when I use the default response-rewrite plugin
Environment
- APISIX version (run
apisix version):
- Operating system (run
uname -a):
- OpenResty / Nginx version (run
openresty -V or nginx -V):
- etcd version, if relevant (run
curl http://127.0.0.1:9090/v1/server_info):
- APISIX Dashboard version, if relevant:
- Plugin runner version, for issues related to plugin runners:
- LuaRocks version, for installation issues (run
luarocks --version):
Description
1.upstream body may response:
{ "data": [], "total": 100 }http status code: 200
then I want to rewrite it like :
{ "data":{ "data": [],"total": 100} , "errcode": 0 }http status code: 200
2.upstream body may response:
"Internal error."http status code: 500
then I want to rewrite it like :
{ "msg": "Internal error.", "errcode": 500, "data": null }http status code: 200
I want to know how to do it when I use the default response-rewrite plugin
Environment
apisix version):uname -a):openresty -Vornginx -V):curl http://127.0.0.1:9090/v1/server_info):luarocks --version):