question - change json field value via http proxy process #2815
-
Hi! I will create an API proxy application based on your http-reverse-proxy example, whose task is to modify the answer under certain conditions! So my question is what is the suggested way to change a json field value to another value? Example responseHere I want to change the 'state' field of the json structure in the http message body from 4 to 2: 45ec726 3 main.c:45:forward_request FORWARDING: GET /bmenarrator/new_job.php Environmentmongoose-7.13 Linux version 6.1.0-22-amd64 ([email protected]) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian 6.1.94-1 (2024-06-21) g++ (GCC) 13.2.0 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Please don't open an issue if you have a question. Moved to the "questions" section. |
Beta Was this translation helpful? Give feedback.
Please don't open an issue if you have a question. Moved to the "questions" section.
There is no Mongoose issue here, just you wanting to do something and not knowing how to do it.
Unfortunately, what you want to do is not related to Mongoose, so you are on your own.
See our examples and tutorials, you have access to every part of the request, including the body; so you can do whatever you want. In fact, you have already printed your data, no one is stopping you from changing that.
Please see our documentation, and follow the guidelines in our tutorials.
https://mongoose.ws/documentation/#json