@CrossOrigin: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 6: Line 6:


Adds headers that configure the browser to consume (or not) the API.
Adds headers that configure the browser to consume (or not) the API.
=Example=
<syntaxhighlight lang='java'>
@RestController
@RequestMapping(path="/inhabitants", produces = "application/json")
@CrossOrigin(origins="*")
public class InhabitantsController {
  ...
}
</syntaxhighlight>

Revision as of 23:44, 29 March 2019

Internal

Overview

Adds headers that configure the browser to consume (or not) the API.

Example

@RestController
@RequestMapping(path="/inhabitants", produces = "application/json")
@CrossOrigin(origins="*")
public class InhabitantsController {
  ...
}