Add method for testing json

This commit is contained in:
DingZQ
2022-09-03 13:23:43 +08:00
parent 3ca92b6c46
commit 8f26827a90

11
main.py
View File

@@ -185,6 +185,15 @@ async def download_inp(name: str, response: Response):
response.status_code = status.HTTP_400_BAD_REQUEST
return True
@app.get("/getjson/")
async def get_json():
return JSONResponse(
status_code = status.HTTP_400_BAD_REQUEST,
content={
'code': 400,
'message': "this is message",
'data': 123,
}
)