Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1738

Handle application/x-www-form-urlencoded entity

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 4.0.0.Beta1
    • Component/s: None
    • Labels:
      None

      Description

      Given a resource method like

         @Path("test")
         public static class TestResource {
            
            @POST
            @Path("form")
            public String formParam(@FormParam("fp") String fp, String content) {
               return fp + "|" + content;
            }
      

      and

            ResteasyClient client = new ResteasyClientBuilder().build();
            Invocation.Builder request = client.target("http://localhost:8081/test/form").request();
            Response response = request.post(Entity.entity("fp=abc", "application/x-www-form-urlencoded"));
            System.out.println("response: " + response.readEntity(String.class));
      

      the output will be

      response: abc|
      

      because the entity will get eaten in the course of retrieving the form parameter.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                ron_sigal Ron Sigal
                Reporter:
                ron_sigal Ron Sigal
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: