Cannot get data after login session key method

The site I’m building is done using AngularJS front-end and Windows webforms in the back-end. I believe the Authorization done through Session Key.

So you create a AngularJS Post method to “login” and then you execute another method to “getuserdata”.


{ "method": "logintheconsumer",

Get User Details:

{ "method": "getconsumerdetails" }

This works correctly using POSTMAN API App, but when I implement the code in JavaScript/AngularJS, it throws error response.

I have not implemented any other code structure. What Am I missing … ?


That could be an issue of server side. You need to make sure CORS in Webconfig is allowed to access their Service. This may work.

                <add name="Access-Control-Allow-Origin" value="*" />
                <add name="Access-Control-Allow-Headers" value="Origin, X-Requested-With, Content-Type, Accept, Cache-Control" />
                <add name="Access-Control-Allow-Methods" value="GET,PUT,POST,OPTIONS" />