JelleS
Posts: 1
Joined: Tue May 14, 2019 9:09 am

Response codes for invalid requests

Tue May 14, 2019 9:42 am

https://www.thesportsdb.com/api/v1/json ... hp?id=Fake returns following repsonse:

Code: Select all

{
"events": "Invalid League ID passed"
}

with a status code of 200. I would suggest following changes:

Since this is basically a "bad" request, maybe return a status code 400 (or 404)?
Maybe the error message should have a key other than "events"?

Thoughts?

User avatar
zag
Site Admin
Posts: 699
Joined: Tue Oct 11, 2016 9:43 am

Re: Response codes for invalid requests

Tue May 14, 2019 9:44 am

Yes I have been wondering this myself, do you have a suggestion of the exact JSON data that should be returned?

Return to “Developers”