lundi 5 décembre 2016

How to handle if the JSON response is nil, Rails 3?

I have a rails app. I have an API method that returns the item detail in JSON. But in case if the item id is nil how to handle that from rails app. I read something like responding with HTTP 404 0r 204.Is that the best way to do it?

Aucun commentaire:

Enregistrer un commentaire