0

I am using the Bayeux Java Client, and I am trying to add a request header for all the requests made to the server, including the handshake request.

Currently I am using :

   mTransport = new LongPollingTransport(options, httpClient) {
        @Override
        protected void customize(ContentExchange exchange) {
            super.customize(exchange);
            if (mCrumb != null) {
                exchange.addRequestHeader("Header Key", "Header value");
            }
        }
    };

    mClient = new BayeuxClient(HANDSHAKE_URL, mTransport);

Is this the right way? I am not able to get it to work? Thanks,

Vishesh Joshi
  • 1,601
  • 2
  • 16
  • 32

1 Answers1

1

That is the right way to do it.

In the CometD test suite there is a test that performs what you are doing.

sbordet
  • 16,856
  • 1
  • 50
  • 45