I have a table with cities that has a foreign key constraint on another table, countries. What status code should I return if the client sends a POST request with a city that references a country that doesn't exist in the countries table? I was thinking 400 BAD REQUEST
, but this seems to be related only to the syntax of the request.
404 Not Found would be a better option. With an error message "country not found".