Skip to content

Commit

Permalink
documentation precisions
Browse files Browse the repository at this point in the history
about TServiceCustomStatus and HTTP_NOCONTENT
  • Loading branch information
Arnaud Bouchez committed Jan 22, 2024
1 parent 1f34521 commit 332ff13
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/core/mormot.core.interfaces.pas
Expand Up @@ -766,8 +766,9 @@ TServiceCustomAnswer = record
// regular HTTP_* response code, in addition to the regular JSON answer - i.e.
// there will be a "result" member in the transmitted JSON anyway
// - the returned value should be in HTTP response code range, i.e. 200..599
// - by design, HTTP_NOCONTENT can not be used: return HTTP_SUCCESS and let
// the web server class decide if there is no output body content involved
// - by design, HTTP_NOCONTENT can/should not be used: return HTTP_SUCCESS and
// set rsoHttp200WithNoBodyReturns204 option to let TRestServer.Uri decide and
// return HTTP_SUCCESS if there is an output body, or HTTP_NOCONTENT if void
TServiceCustomStatus = type cardinal;


Expand Down
2 changes: 1 addition & 1 deletion src/mormot.commit.inc
@@ -1 +1 @@
'2.2.6795'
'2.2.6796'
11 changes: 5 additions & 6 deletions src/rest/mormot.rest.server.pas
Expand Up @@ -1559,12 +1559,11 @@ TRestRouter = class(TSynPersistent)
// - unauthenticated requests from browsers (i.e. not Delphi clients) may
// be redirected to the TRestServer.Auth() method via rsoRedirectForbiddenToAuth
// (e.g. for TRestServerAuthenticationHttpBasic popup)
// - some REST/AJAX clients may expect to return status code 204 as
// instead of 200 in case of a successful operation, but with no returned
// body (e.g. a DELETE with SAPUI5 / OpenUI5 framework): include
// rsoHttp200WithNoBodyReturns204 so that any HTTP_SUCCESS (200) with no
// returned body will return a HTTP_NOCONTENT (204), as expected by
// some clients
// - some REST/AJAX clients may expect to return status code 204 instead of 200
// in case of a successful operation, but with no returned body (e.g. DELETE
// with SAPUI5 / OpenUI5 framework): include rsoHttp200WithNoBodyReturns204
// so that any HTTP_SUCCESS (200) with no returned body will return a
// HTTP_NOCONTENT (204), as expected by some clients
// - by default, Add() or Update() will return HTTP_CREATED (201) or
// HTTP_SUCCESS (200) with no body, unless rsoAddUpdateReturnsContent is set
// to return as JSON the last inserted/updated record
Expand Down

0 comments on commit 332ff13

Please sign in to comment.