The request.param("foo") method looks at HTTP parameters (as well as the named elements from the HTTP path). In the example class you mentioned, RestTermVectorsAction, you can see how the paths that class handles are registered in the constructor, and that elements of the path have stuff like {index}, which would be available when processing the request with request.param("index").
However, to parse the body of the request, you want request.contentParser(). Again, in the class you mentioned, the is the code that parses the body:
You'll notice that a slightly different variant of contentParser() is called there, but that is likely not relevant in your case (it falls back to parsing json with an HTTP source parameter passed within the URL).
Thank you! I checked out the parseRequest method in TermVectorsRequest to get a better idea at what it was doing and was able to successfully read in the json fields. This can be closed!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.