ipkn / crow

Crow is very fast and easy to use C++ micro web framework (inspired by Python Flask)
BSD 3-Clause "New" or "Revised" License
7.46k stars 889 forks source link

Json file load #357

Open ghost opened 4 years ago

ghost commented 4 years ago

How to load and serve JSON file ?

The-EDev commented 3 years ago

well this is kinda late, but I would recommend using jsoncons, it lets you load a json file or string into a json object, modify it, and then just dump the object as string.

Now if you only want to take a json file and put it in a response you can just read it as string, and then pass that string with the header Content-Type: application/json.