Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6677

Content-Type is empty on POST request with empty body

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.4
    • Fix Version/s: 3.1.5, 3.0.8, 3.2.0
    • Component/s: None
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      I have following code:
      endpoint:

      @Path("/")
      @Produces(MediaType.APPLICATION_JSON)
      @Consumes(MediaType.APPLICATION_JSON)
      public interface MyApi
      {
      	@Path("invoices/{number}/bookkeep")
      	@PUT
      	String bookkeep(@PathParam("number") String invoiceNumber);
              ...
      
      }

      client configuration:

      JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
      bean.setAddress("http://localhost");
      bean.setInheritHeaders(true);
      bean.setThreadSafe(true);
      bean.setServiceClass(MyApi.class);
      MyApi myApi = bean.create(MyApi.class);

      When I run

      myApi.bookkeep("111");

      Result:

      Http-Method: PUT
      Content-Type: 
      Headers: {Access-Token=[aaa], Accept=[application/json]}

      Expected:

      ...
      Content-Type: application/json
      ...

      With cxf-rt-rs-client version 3.0.3 Content-Type is application/json.
      With cxf-rt-rs-client version 3.1.4 Content-Type is empty.

        Attachments

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              pavko Pavel Kokush
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: