Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8209279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:40:13+00:00 2026-06-07T09:40:13+00:00

I am using RESTEasy (implementation of JAX-RS). I can’t find a way to set

  • 0

I am using RESTEasy (implementation of JAX-RS).
I can’t find a way to set basic, preemptive, authentication to ClientRequest.

ClientRequest request = new ClientRequest("<url>");
// -- here I want to add basic-preemptive authentication --
ClientResponse response = request.get();
System.out.println(response.getEntity(String.class));

What the correct way to do it?
Is there any other way to do it?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T09:40:14+00:00Added an answer on June 7, 2026 at 9:40 am

    If you look at the constructors in ClientRequest, you will see that one of them takes a string and a ClientExecutor.

    So you can do something like this:

    ApacheHttpClient4Executor executor = new ApacheHttpClient4Executor();
    DefaultHttpClient client  = (DefaultHttpClient) executor.getHttpClient();
    client.addRequestInterceptor(new MyPreemptiveAuthInterceptor(), 0);
    
    ClientRequest request = new ClientRequest("http://my-url", executor);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using RESTEasy 2.2.1.GA as my JAX-RS implementation to create a client to connect
I am designing a JAX-RS REST Server using Clojure and RESTEasy . It is
I am using the RestEasy library to do JAX-RS web services. I am not
Tech Stack: Java 1.6, JAXB, Spring 3, JAX-RS (RESTEasy), XSD Hello, I am using
I am using restEasy(Restful implementation for jboss) ejb3.0, Jboss5.1.1 AS I did restful service
Is there an easy, not using spring, way to have RESTeasy return a jsp
I am developing a JAX-RS webservice using RestEasy 2.2.2 to be deployed to Tomcat
I'm using EclipseLink's MOXy as the JAXB implementation in my RESTEasy project.MOXy's advanced functionality
I have a scenario where ExceptionMapper are used in JAX-RS using RESTeasy 2.0.1.GA .
I am working on developing a JAX-RS webservice using RestEasy 2.2.2 to be deployed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.