[Answer]-AngularJS $http.post not getting JSON success response. Instead redirects to URL of the REST endpoint

0👍

Have you tried this:

<FORM ng-submit="form_submit()">

instead of

<body ng-submit="form_submit()">

It should (hopefully) post your $http in the background

👤Manube

1👍

Try to add / slash at the end of POST url (see the APPEND_SLASH setting for reference):

$http.post("127.0.0.1:8000/api/forms/create/"...

0👍

your form_submit variable in the controller is not a scope variable.

Instead of using

var form_submit

change it to

$scope.form_submit

I think this will work.

👤srthu

Leave a comment