Reputation: 516
I'm trying to make post json call but it is showing call type "text/html" in develepors tools
here is my ajax and jquery call both of them posting same call
var dataString='query='+search_value;
$.ajax({
url: '/reports/search',
type: 'post',
dataType: 'json',
data: dataString,
success:function(data){
console.log("success"+data);
}
});
jquery
$.post( "/reports/search", { query: search_value},function(data) {
console.log(data);
},"json");
here is the screenshot of the request
what's wrong with my request
Upvotes: 0
Views: 91
Reputation: 1542
var dataString='query='+search_value;
$.ajax({
url: 'yourbase url'+'/reports/search',
type: 'post',
You have to define your base URL or proper URL to make Ajax call.
Upvotes: 1