Variable number of parameters... #2466
-
Hi good afternoon! I've been looking for some answer similar to this one but I haven't been able to find one. If someone has asked this before please just let me know about it. We have a software written in C code which has to parse parameters in JSON format and the problem is that parameters are related to some commands and all the commands has a different number of parameters. Por example: we have the path: /api/settings and sometimes the content is
other times, the content is:
With this, I mean the number of parameters of the json request is different depending on the command requested but the path is alwayse the same. Is not possible to create different paths for different commands because the software hadles hundreds if not thousands of commands. So my question is if there is any way to get the key and values and add them to a hash table data structure for example or something similar? Is it possible to do something like this?:
Is this possible in mongoose? Thank you so much in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
What's possible in Mongoose is what is described in its documentation, examples and tutorials available. https://mongoose.ws/documentation/#json Lines 2790 to 2804 in d18b2b3 |
Beta Was this translation helpful? Give feedback.
What's possible in Mongoose is what is described in its documentation, examples and tutorials available.
https://mongoose.ws/documentation/#json
For your particular case I guess https://mongoose.ws/documentation/#mg_json_next might work ?
mongoose/test/unit_test.c
Lines 2790 to 2804 in d18b2b3