1

I would like to use Parse with AngularJS. I'm a new one in both... I'm trying to create a new user but i receive the error "bad request".

Here is my controller (linked to two input html tags):

var myAppControllers = angular.module('myApp.controllers', []);

myAppControllers.controller('SignUpCtrl', ['$scope', '$http',
  function($scope, $http) {
    $scope.results = []

        $scope.signUp = function() {
         $http({method : 'POST',
                url : 'https://api.parse.com/1/users', 
                headers: { 'X-Parse-Application-Id':'xxx', 'X-Parse-REST-API-Key':'xxx'},
                params: {
                    where: {
                        username: $scope.username,
                        password: $scope.password
                    }

                }}  )
            .success(function(data, status) {
                $scope.results = data;
             })
            .error(function(data, status) {
                alert("Error");
            })
        }
  }]);
3
  • I have never used parse.com and just had a look at the API. According to parse.com/docs/rest#users-signup there is no where object in the post data. Commented Jul 4, 2014 at 7:36
  • try using 'data' instead of 'params'. Params is used for appending onto the end of the url like a query string, data is used for submitting data when making a post request. Commented Jul 4, 2014 at 9:08
  • Thanks I'm going to try with your comments Commented Jul 4, 2014 at 11:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.