txindex without quotes:
$ curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getindexinfo", "params": [txindex]}' -H 'content-type: text/plain;' http://127.0.0.1:18333/
{"result":null,"error":{"code":-32700,"message":"Parse error"},"id":null}
txindex with quotes:
$ curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getindexinfo", "params": ["txindex"]}' -H 'content-type: text/plain;' http://127.0.0.1:18333/
{"result":{"txindex":{"synced":true,"best_block_height":2032943}},"error":null,"id":"curltest"}