this.getArray = function(callback){
$http({
method: "post",
url: "index.php?modulo=ClientesOnline&acao=getClientes",
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
data: $.param({ajax:1}),
}).success(callback);
//$http.post("index.php?modulo=ClientesOnline&acao=getClientes", {ajax:1}).success(callback);
};
Personally, the code above was made by me through various searches.
My question
There is some easier way to write this line:
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
Because 'application/x-www-form-urlencoded'
is a little complicated to write on a day to day basis. :
Thank you in advance! Thanks.