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

Unable to override Content-Type on GET requests

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.2
    • Fix Version/s: 3.1.3, 3.0.7
    • Component/s: None
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      Please consider the following code:

      ClientBuilder.newClient()
      .target("http://localhost")
      .request(MediaType.APPLICATION_JSON)
      .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
      .get();

      which results in:

      GET / HTTP/1.1
      Content-Type: /
      Accept: application/json
      User-Agent: Apache CXF 3.1.2
      Cache-Control: no-cache
      Pragma: no-cache
      Host: localhost
      Connection: keep-alive

      Expected would be:
      ...
      Content-Type: application/json
      ...

      I'm using the following dependency:
      compile 'org.apache.cxf:cxf-rt-rs-client:3.1.2'

      Is there any way to set the Content-Type on GET requests?

        Attachments

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              MrSpock Michael Kunze
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: