Rest api's Give a 302 found and redirects to Login Page
finally I got the issue. It was related to the api URL. In ubuntu we created a link folder so the url worked. In windows the symbolic link was not created and also doesn't work so based on htaccess since the api was not found at the location it was redirecting to login page .
Small thing but took hours to nail it down . Thanks anyways :)