All browsers do an OPTIONS requests while is CORS doing any kind of requests to a REST server. I had recently faced a similar issue with Python Flask and Angular JS and once i fixed it, i blogged about it
here. I don't know your REST server is, but what i think you should do to get this working for would be to allow
OPTIONS request method in your REST endpoint, and add
'authorization' to the
'Access-Control-Allow-Headers' and also add "
localhost:9998" to 'Access-Control-Allow-Origin' . And i think everything else is correct with your setup.