i have elastic API and i try to fetch it with javascript and query on the fetch, but i don't know where to place the query, i only know how to fetch it just with authorization, can we fetch the elastic api with query ?
The Elastic Query:
GET http://192.168.150.155:9900/em-employeedata/_search
{
"size": 10000,
"query": {
"match_all": {}
}
}
The Javascript Code:
var url = 'http://192.168.150.155:9900/em-employeedata/_search/';
async function getapi(url) {
const response = await fetch(url, {method:'GET',
headers: {'Authorization': 'Basic ' + btoa('em_user:3md@t@2o22')}})
var data = await response.json();
}
getapi(url);