I am interested in getting the raw body of the HTTP POST request that comes to my endpoint when directly calling the URL where this endpoint lives (https://<my app name>.appspot.com/_ah/api/endpoints/v1/test
) and supplying the body with it. Here is the method of the endpoint which successfully gets called:
@ApiMethod(name = "test", path = "test", httpMethod = ApiMethod.HttpMethod.POST)
public WrappedBoolean test(final HttpServletRequest request, ServletContext servletContext) throws Exception {
//???
return new WrappedBoolean(true);
}
Unfortunately, trying to retrieve the InputStream
from the HttpServletRequest
and then reading it, gives me a -1, meaning all the data has already been read. This makes sense, as the App Engine endpoints runtime has most likely already processed the request by now.
Anyone has a view on how to get a hold of the original POST request that was POSTed to this endpoint?