Hi Stian!

Welcome on board. In order to set the preferences of your client, you can do something along these lines:

        Request request = new Request();
        Client client = new Client(Protocol.HTTP);
        request.setResourceRef(justCreated);
        request.setMethod(Method.GET);
        request.getClientInfo().getAcceptedMediaTypes().
                add(new Preference(MediaType.TEXT_XML));
        Response response = client.handle(request);

This will get converted to an 'Accept: text/xml' header by the HTTP client connector.

Best regards,
Jerome

Reply via email to