angularjs - Login to Parse.com DB using API returns XMLHttpRequest header error -


here call make parse.com's api login user:

var deferred = $q.defer(); $http({     method: "get",     url: "https://api.parse.com/1/login",     headers: {         "x-parse-application-id": parse_credentials.app_id,         "x-parse-rest-api-key": parse_credentials.rest_api_key,         "content-type": "application/json"     },     data: {         "username": credentials.username.tolowercase(),         "password": credentials.password     } }).success(function(data) {     deferred.resolve(data); }).error(function() {     deferred.reject("error") }); return deferred.promise; 

when trigger angular service method, following error in console:

xmlhttprequest cannot load https://api.parse.com/1/login. request header field access-control-allow-headers not allowed access-control-allow-headers. 

i'm not sure how resolve this. here current contents of common headers object angular app:

object {accept: "application/json, text/plain, */*", access-control-allow-headers: "origin, content-type, accept"} 

i implement $http service same custom classes without error. difference url. can provide answer why getting error?

edit: this other question, i've gathered header field error result of header in parse.com response, not in request. not sure how proceed now.

edit 2: attached image of http request , response headers when ping login api url.

enter image description here

are setting these headers http requests somewhere in angular app?

i'm not sure how resolve this. here current contents of common headers object angular app:

object {accept: "application/json, text/plain, */*", access-control-allow-headers: "origin, 

these should come server (response headers), if being set somewhere in request, server error due headers not expecting.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -