I noticed that my Angular is creating OPTIONS request also before each POST request.
I'm using custom API Service for HTTP request handling.
app.service('ApiService', function ($http) {
/**
* Process remote POST request to give URL with given params
* @param {String} url
* @param {String} POST params
* @return {JSON} response from server
*/
this.doHttpRequest = function (type, url, params) {
return $http({
method: type,
url: url,
data: params,
timeout: 5000,
headers: {
"Content-Type": "application/json",
}
});
}
});
Question is:
How can i disable it (which config values put where)?
Is OPTIONS good for something? I think that is it something like "Handshake between 2 servers".
Angular version: 1.2.15
Thanks for any advice.