You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PTAL here. Maybe the user sent an invalid URL? In that case a status of 422 (Unprocessable Entity) would be more appropriate.
In general it would be great to test first if the URL is reachable and fail fast otherwise. This can be done as part of the validations made to the Credentials payload. Also it could check if the credentials are rejected and then return a status code of 401.
WDYT?
The text was updated successfully, but these errors were encountered:
An invalid URL is not a bad request (400). It is just an invalid value for a mandatory field, that's why I suggest using status 422 in this case. Regarding 401 (Unauthorized), that's the status that should be returned in case the credentials are rejected.
In general, status 400 would be suitable when the client sends a malformed payload (e.g. omits the username, that is a mandatory field)
PTAL here. Maybe the user sent an invalid URL? In that case a status of 422 (Unprocessable Entity) would be more appropriate.
In general it would be great to test first if the URL is reachable and fail fast otherwise. This can be done as part of the validations made to the
Credentials
payload. Also it could check if the credentials are rejected and then return a status code of 401.WDYT?
The text was updated successfully, but these errors were encountered: