What would be similar response headers to what exists in PHP world
currently?
1. header('Access-Control-Allow-Origin: *');
2. header('Content-Type: application/json');
Reading OACS documentation, as well as examples of code, I've written the following correspondent to #2
doc_return 200 "application/json" $json
But, failed to find a solution to #1. I did even tryed to use the intuition as in:
doc_return 200 {"access-control-allow-origin:*; application/json;"} $json
However, in the case of Access-Control-Allow-Origin, things turned to be trickier as already expected.
After applying a few possibilities:
i. as the second argument of doc_return,
ii. as a new argument;
iii. forcing the script by adding directly in the HTML header of the page;
...
In all cases, JSON format seems to break.
What would be the proper way to implement header('Access-Control-Allow-Origin: *')?
Best wishes