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

Content-Type is empty on POST request with empty body

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1.4
    • 3.1.5, 3.0.8, 3.2.0
    • None
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: