POST
import requests
import json
def post_request():
headers = {'content-type': "application/json"}
url = "http://127.0.0.1:9200/test/_delete_by_query"
data = {
"query": {
"match_all": {}
}
}
x = requests.post(url, data = json.dumps(data), headers = headers, timeout=60)
print(x.text)
GET
import requests
import json
def get_request():
url = "http://10.11.68.224:8888/api/admin/queries/rq_status"
headers = {"Content-Type":"application/x-www-form-urlencoded", "Authorization": "uyyP3NuSYmQKkLjCRJmm3lPYktLErITD7rt6cVSb"}
result = requests.get(url, headers = headers)
print(result.text)
if __name__ == '__main__':
get_request()