title: post request with multiple parameters JSON and String on Jackson/Jersey JAVA
body: <p>I've created a rest api using Jersey/Jackson and it works well.  I want to adjust my POST methods to receive a string token in addition to the POJO they are receiving as JSON.   I've adjusted one of my methods like so: </p>
  
  <pre><code>@POST
  @Path("/user")
  @Consumes(MediaType.APPLICATION_JSON)
  public Response createObject(User o, String token) {
      System.out.println("token: " + token);
      String password = Tools.encryptPassword(o.getPassword());
      o.setPassword(password);
      String response = DAL.upsert(o);
      return Response.status(201).entity(response).build();
  
  }
  </code></pre>
  
  <p>I want to call that method, but for whatever reason token prints to null no matter what I try.  Here is the client code I've written to send the post request: </p>
  
  <pre><code>public String update() {
  
      try {
          com.sun.jersey.api.client.Client daclient = com.sun.jersey.api.client.Client
                  .create();
          WebResource webResource = daclient
                  .resource("http://localhost:8080/PhizzleAPI/rest/post/user");
  
          User c = new User(id, client, permission, reseller, type, username,
                  password, name, email, active, createddate,
                  lastmodifieddate, token, tokentimestamp);
          JSONObject j = new JSONObject(c);
          ObjectMapper mapper = new ObjectMapper();
  
          String request = mapper.writeValueAsString(c) + "&amp;{''token'':,''"
                  + "dog" + "''}";
          System.out.println("request:" + request);
          ClientResponse response = webResource.type("application/json")
                  .post(ClientResponse.class, request);
          if (response.getStatus() != 201) {
              throw new RuntimeException("Failed : HTTP error code : "
                      + response.getStatus());
          }
  
          System.out.println("Output from Server .... \n");
          String output = response.getEntity(String.class);
          setId(UUID.fromString(output));
          System.out.println("output:" + output);
          return "" + output;
      } catch (UniformInterfaceException e) {
          return "failue: " + e.getMessage();
      } catch (ClientHandlerException e) {
          return "failue: " + e.getMessage();
      } catch (Exception e) {
          return "failure: " + e.getMessage();
      }
  
  }
  </code></pre>
  
  <p>Any help would be greatly appreciated.  </p>