Change profile in frontend with ajax I'm trying to update some checkbox fields through the frontend with ajax.
After clicking / change of the checkbox the form needs to update the profile. 

Template code:

&lt;form class="form-horizontal form-ajax" method="POST" action="" accept-charset="UTF-8" id="notificaties"&gt;
{{ getCsrfInput() }}
&lt;input type="hidden" name="action" value="/users/saveUser"&gt;
&lt;input type="hidden" name="redirect_" value="account"&gt;
&lt;input type="hidden" name="userId" value="{{ user.id }}"&gt;

    &lt;ul class="action-list"&gt;

        &lt;li&gt;
            &lt;p&gt;

            Ontvang updates over leuke nieuwe producten
            &lt;span class="pull-right"&gt;
                &lt;input type="hidden" name="fields[emailUpdates]" value="0"&gt;
                &lt;input class="ajaxcheck" type="checkbox" id="fields_emailUpdates" name="fields[emailUpdates]" value="1" {% if user is defined and user.emailUpdates %} checked="checked"{% endif %}&gt;
            &lt;/span&gt;

            &lt;/p&gt;
        &lt;/li&gt;
        &lt;li&gt;
            &lt;p&gt;

            Ontvang email updates over geinteresseerde kopers
            &lt;span class="pull-right"&gt;
                &lt;input type="hidden" name="fields[emailReactie]" value="0"&gt;
                &lt;input class="ajaxcheck" type="checkbox" id="fields_emailReactie" name="fields[emailReactie]" value="1" {% if user is defined and user.emailReactie %} checked="checked"{% endif %}&gt;
            &lt;/span&gt;

            &lt;/p&gt;
        &lt;/li&gt;
        &lt;li&gt;
            &lt;p&gt;

            Ontvang wekelijks een upate over de producten van jou favoriete verkopers
            &lt;span class="pull-right"&gt;
                &lt;input type="hidden" name="fields[emailFavorieten]" value="0"&gt;
                &lt;input class="ajaxcheck" type="checkbox" id="fields_emailFavorieten" name="fields[emailFavorieten]" value="1" {% if user is defined and user.emailFavorieten %} checked="checked"{% endif %}&gt;
            &lt;/span&gt;

            &lt;/p&gt;
        &lt;/li&gt;

        &lt;li&gt;
            &lt;p&gt;

            Ontvang email updates van de reacties van jou producten
            &lt;span class="pull-right"&gt;
                &lt;input type="hidden" name="fields[emailComments]" value="0"&gt;
                &lt;input class="ajaxcheck" type="checkbox" id="fields_emailComments" name="fields[emailComments]" value="1" {% if user is defined and user.emailComments %} checked="checked"{% endif %}&gt;
            &lt;/span&gt;

            &lt;/p&gt;
        &lt;/li&gt;

    &lt;/ul&gt;
 &lt;/form&gt;


JS code:

 $(".ajaxcheck").click(function(){
    var data = $(this).parents('form').serialize()

    $.ajax({
        context: this,
        method: "POST",
        dataType: "json",
        url: "/actions/users/saveUser",
        success: function(data, response){
            $(this).parents('.account-item').remove();
            console.log("success", response, data);
        }
    });
});


But it gives me an error: GET http://shop.craft.dev/actions/users/saveUser 400 (Bad Request)

The form gets updated. So it works. But it still gives me this error:

In my craft.log file:

exception.Craft\HttpException.400
Message exception 'Craft\HttpException' in /Volumes/HDD Drive/Sites/Shop/app/controllers/BaseController.php:191
The 400 error you’re getting is coming from BaseController::requirePostRequest(). It’s happening because this line:

type: "post",


should be:

method: "POST",