I am having difficulty understanding how can I return all methods that are allowed on my HTML page or on my embedded jetty-9.4.4.v20170414 server using Spark framework?
Java Spark code:
options("/panel/data/options", (request, response) -> request
.headers("Access-Control-Request-Method"));
AngularJS code:
$scope.options = function(){
$http({
method: 'OPTIONS',
url: 'http://localhost:4567/panel/data/options',
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
}).then(function succesCallback(response){
alert(response.data)
});
};
This is what I have so far.