Giter Site home page Giter Site logo

Comments (3)

gav- avatar gav- commented on August 16, 2024

I will assume that you mean 404 (Not Found) in place of 401 (Unauthorized) in your comment.

The difficulty here is how to map a search-like function onto a REST-like URL and return an intelligible error code when the URL is correct, but the search returned no results.

A HTTP 404 code cannot be returned in your case as the URL is actually valid. In the case of a URL in the form of http://{server}/RESTfm/{database}/layout/{layout}/{recordId} with a non-existent {recordId} then the result will be HTTP 404.

So returning HTTP 500 and passing the FileMaker response code through as X-RESTfm-FM-Status (in both the HTTP header and in whichever output format you are using) is by design.

from restfm.

marioantonini avatar marioantonini commented on August 16, 2024

Just found this question in SO and was thinking that 204 might be appropriate.

from restfm.

gav- avatar gav- commented on August 16, 2024

At one point RESTfm used 204 in response to DELETE operations, but in trying to support rather limited HTTP clients (like FileMaker itself) that could not differentiate the 2xx return codes, we standardised on 200 for all successful operations.

FileMaker "find" can return many different error responses, only "No records match the request" could possibly map to HTTP 204. Client code must already expect HTTP 500 from RESTfm as an indicator to inspect X-RESTfm-FM-Status for details of the other cases, so there isn't any additional overhead in detecting the simple case for not matching any records (client side).

Thanks for your suggestion, even though we are unlikely to be breaking RESTfm's behaviour now that it's established, it is always worth revisiting some of these points.

from restfm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.