jersey
  1. jersey
  2. JERSEY-1524

WebResource.header() method does not set HTTP Header

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Works as designed
    • Affects Version/s: 1.14
    • Fix Version/s: 1.15
    • Component/s: core
    • Labels:
      None

      Description

      Unable to set HTTP Header calling WebResource.header() method as described in API
      You have to use something like below

      webResource.header(HttpHeaders.AUTHORIZATION,"OAuth "+accessToken).post(ClientResponse.class,queryParams);

        Activity

        Hide
        Marek Potociar added a comment -

        When you say "unable to set ...", what do you mean exactly? Is there an error, the header is not set on the request or what?

        Show
        Marek Potociar added a comment - When you say "unable to set ...", what do you mean exactly? Is there an error, the header is not set on the request or what?
        Hide
        Martin Matula added a comment -

        WebResource.header() returns a request builder with the header set - i.e. it does not set the header on the WebResource itself. This is as designed.

        Show
        Martin Matula added a comment - WebResource.header() returns a request builder with the header set - i.e. it does not set the header on the WebResource itself. This is as designed.

          People

          • Assignee:
            Martin Matula
            Reporter:
            sswain
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: