How to return single item from DB using CURL
# help
d
How to return single item from DB using CURL
Is it possible to return a single item using SB curl requests? I only see the .single() method for javascript but not sure how to do this via CURL. Thanks!
r
add -H "Accept: application/vnd.pgrst.object+json" Docs ref: https://postgrest.org/en/stable/api.html?highlight=return%20object#singular-or-plural
d
You are a 👑 ! Will this return an error if the result is empty too?
> When a singular response is requested but no entries are found, the server responds with an error message and 406 Not Acceptable status code rather than the usual empty array and 200 status:
The doc you sent says yes, thanks mate!