The previous version of API is a bit chaotic on reponse bodies, so now I have made the function generate_response in src/utils.py, which takes in data, code, and an optional header. This function will use json.dumps to put the data parameter into the content section of the response body and give the response a corresponding status code.
The previous version of API is a bit chaotic on reponse bodies, so now I have made the function
generate_responseinsrc/utils.py, which takes indata,code, and an optionalheader. This function will usejson.dumpsto put the data parameter into the content section of the response body and give the response a corresponding status code.