Add method for testing json
This commit is contained in:
11
main.py
11
main.py
@@ -185,6 +185,15 @@ async def download_inp(name: str, response: Response):
|
|||||||
response.status_code = status.HTTP_400_BAD_REQUEST
|
response.status_code = status.HTTP_400_BAD_REQUEST
|
||||||
return True
|
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,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user