I got it. I used a wrapper that will post the query body like this. XXX is the base64-encoded query term.
GET /_search { "query": { "wrapper": { "query": "XXX" } } }