About 34,700 results
Open links in new tab
  1. What should I do when there is no data to return from a REST endpoint ...

    My question is, in the case where there are no "next" messages do I respond with an HTTP 204 (No Response) or should I simply return {}? What's the best practice in this situation?

  2. The Best Way to Return Responses in REST APIs - Medium

    Sep 18, 2025 · If not, even a well-written backend feels broken. In this article, we’ll explore the best practices for returning responses in REST APIs, with examples and patterns you can apply right away.

  3. Best Practices for REST API Error Handling | Baeldung

    May 11, 2024 · In this tutorial, we’ll learn about some of the best practices for handling REST API errors, including useful approaches for providing users with relevant information, examples from large-scale …

  4. Should "No Results" be an error in a RESTful response?

    Sep 28, 2017 · I'd argue that returning a 204 is inappropriate, as you are returning content. It's just that the content has no results, which is distinct from returning no content at all.

  5. What should I return from my API when the request is normal ... - Reddit

    Jan 6, 2023 · Should I return a service response that wraps the data and says whether it was a success or failure? And what should I return if there are random exceptions that cause problems, like a …

  6. HTTP response status codes - MDN Web Docs

    Jan 5, 2026 · This response is sent when the requested content has been permanently deleted from server, with no forwarding address. Clients are expected to remove their caches and links to the …

  7. How should a REST Endpoint Handle No Results? - Brian Cline

    Jul 1, 2022 · If it’s a single resource request and there’s no resource to return, you should return a 404 or Item Not Found Error. If there’s an item but the user doesn’t have access to it, then you should …

  8. Flask Routes No Response Fix How To Return Data - sqlpey

    Jul 25, 2025 · Learn how to fix Flask routes that don't return responses. Explore common errors and solutions for ensuring your web application correctly sends data back to the client.

  9. REST API - what to return when query for a GET does not find a result

    Aug 27, 2022 · So at the HTTP level, the answers to your question are easy: if there's a current representation, then you reply to GET requests with a 200 status and copy the current representation …

  10. Console warning: `API handler should not return a value ... - GitHub

    Apr 28, 2023 · Basically you're not supposed to return anything from your routes, but you can return res.end() for example (or whatever else that has the same signature). Also, my return …