Delphi 12 / Datasnap Server
I was created ‘Datasnap Server’ by wizard. This ma REST server. Angular application send me requests (GET or POST) but CORS makes communication difficult.
I modified header by adds some Allow-*, but is still problem with OPTIONS http method.
curl -i -X OPTIONS my_url
Response from server:
HTTP/1.1 500 Internal Server Error
Result is exception class TDSServiceException with message : ‘Command closed or unassigned’
In unit Datasnap.DSHTTP is function: DoRESTCommand and he skip command type OPTIONS.
Is it possible to control the request/response so that the server responds with 200 OK in this case?