Accessing SQL API from http(s)

wonder if there are any way to call ES SQL API, say like
http://localhost:9200/_sql?format=json&source={“query”: “SELECT 1” }
similer to

This gives error. "source and source_content_type parameters are required"


the following curl script works fine.

curl -X GET "localhost:9200/_sql" -H 'Content-Type: application/json' -d'SELECT 1'

minimal script to create the index

PUT hockey/_bulk?refresh

@madhusoodanan yes, this is possible:

http://localhost:9200/_sql?source={"query":"SELECT 1"}&source_content_type=application/json&format=txt
1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.