GET request

Hi,
I send a POST request to an api with one data like that:

jQuery(function() {
        $.ajax({
            url: '/api/ask_Config',
            method: 'POST',
            dataType: 'json',
            data: { Mode:$('#mode').val() },
            success: function(json) {}

It works but if i go on http://../api/ask_Config?Mode=3 i don't receive the parameter (3) into my server.

Reception:

char WhichModeR [100];
mg_get_http_var(&hm->body, "Mode", WhichModeR, sizeof(WhichModeR));
printf("params: %s\n",WhichModeR);

How can i resolve that ?
Thanks

Comments

Sign In or Register to comment.