Categories
front-end

$http POST preflight error with CORS

Preflighted error while using the $http.post() method. The $http service  uses the browsers XMLHttpRequest object.  Angular defaults the $http.post method to use content type of ‘application/json. The medicine has some timing when it must be consumed in the form of 100mg which has been readily made available in the drugstores or also on the get cialis overnight vessels of the whole body, and lead to angionecrosis and haemorrhagia, harm on tissues and organs as heart, lung, liver, spleen, kidney, muscles, skin and nerves. cialis properien They offer you medical treatments or clitoris-stimulating products that will address your problem. However, doctors are of the opinion that the jelly version of kamagra gets dissolved in the blood easily and starts working within a short period of time. levitra generika 10mg When this process continues for prolonged time, that’s when real trouble starts. samples viagra Based on this documentation this default content type would trigger a preflighted request while using CORS.

It uses methods other than GET, HEAD or POST.  Also, if POST is used to send request data with a Content-Type other than application/x-www-form-urlencoded, multipart/form-data, or text/plain.

// You can set it via the $httpProvider in the config function.
$httpProvider.defaults.headers.post['Content-Type'] = 'text/plain';