Closed
Description
- When post a bad request that should be a json, how can I define the response for the client? It seems just reply "500 Internal Server Error" now. When the client post a request that is not json format, how can I tell the client with the response?
- If I do not set the
-H "Content-Type: application/json"
, but the request data is standard json format, the payload in the server is empty. I just print thepayload
in thepredict
:
print("payload type=", type(payload))
print("payload=", payload)
the print result are below:
payload type= starlette.datastructures.FormData
payload= FormData([]) # it is empty, why?
why the body get by the server is empty?
Thanks a lot!