title: Retrieving all POST data parameters into map with Java Jersey
body: <p>I'm trying to gather all parameters of an HTTP POST request into a map, however it's not working.</p>
  
  <p>With a GET, I used:</p>
  
  <pre><code>@Context
  private HttpServletRequest request;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>@GET
  @Path("/{uuid}/invoke/{method}")
  public Response invokeMethod (
      @PathParam("uuid") String uuid,
      @PathParam("method") String methodz
  ) {
      Map&lt;String, String[]&gt; params = request.getParameterMap();
  </code></pre>
  
  <p>and it returned the map. However, when sending form data via a POST instead of inline with the URL, the map is being returned as NULL.</p>
  
  <p>Is there a similar way to retrieve all the parameters at once using a POST?</p>
  
  <p>EDIT:</p>
  
  <p>My data is being submitted as a serialized JSON, so using a cURL statement as an example:</p>
  
  <pre><code>curl --data "firstname=john&amp;lastname=smith" http://localhost:8080/uuid1/apitest/method1
  </code></pre>
  
  <p>Ideally, I'd want to get a hashmap of something like:</p>
  
  <pre><code>ParamMap["firstname"] = "john"
  ParamMap["lastname"] = "smith"
  </code></pre>
  
  <p>Also, the parameters won't be static, so this cURL:</p>
  
  <pre><code>curl --data "job=construction" http://localhost:8080/uuid2/apitest/method2
  </code></pre>
  
  <p>would result in:</p>
  
  <pre><code>ParamMap["job"] = "construction"
  </code></pre>