Comments (3)
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.
Just found this question in SO and was thinking that 204 might be appropriate.
from restfm.
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)
- Python 3.5+ restfm client HOT 1
- Search with "@" in the URL HOT 2
- operation log remained HOT 4
- Mac OSX 10.12.2 unsupported
- Installing on Windows 2016... HOT 1
- RFMfixFM02 in beta HOT 1
- FMS 16 HOT 1
- Select Distinct HOT 1
- POST not working, all else works perfect HOT 3
- FMS 17 HOT 1
- PHP 7.1 Notice: A non well formed numeric value encountered
- FMS 18 HOT 3
- FileMaker Server 19? HOT 4
- Problem with update
- Class Section needs to implement Countable. PHP >=7.2 breaks FormatHTML HOT 4
- RFMfind SELECT clause requires WHERE clause but should not
- Reverse Proxy support for missmatched baseURI paths
- Need of composer HOT 1
- Web server redirect to RESTfm.php error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from restfm.