Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Costum HTTP Request Headers not working

$
0
0

@dmendes wrote:

I am having some problems sending costum request headers to the server

I wrote the following

$httpProvider.interceptors.push('httpRequestInterceptor');

.factory('httpRequestInterceptor', ['$rootScope', function ($rootScope) {
return {
request: function ($config) {
$config.headers['x-auth-ticket'] = "test";
return $config;
}
};
}])

However when I do a request i get

Request header field x-auth-ticket is not allowed by Access-Control-Allow-Headers in preflight response.

and the Header istead of being there is added in

Access-Control-Request-Headers:accept, x-auth-ticket

so my header

x-auth-ticket: test

is not in the Request headers. Do i have to configure something else in ionic? Or could it be something on the server side?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>