Is your Interceptor defined for your RestService class as documented here?
@Rest(interceptors = { HttpBasicAuthenticatorInterceptor.class })
public interface ImwizardClient {
// ... snipped
}
Alternatively, the workaround posted in this thread seems to work reliably. Just define a custom MessageConverter for your RestService class.
public class GsonWithHeadersConverter extends GsonHttpMessageConverter {
@Override
protected void writeInternal(Object o, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException {
setHeaders(outputMessage); //My method to put the additional headers :)
super.writeInternal(o, outputMessage);
}
}