1

In my Quarkus app, I need to make ah http request to another server, in which the Authorization value needs to be passed.

I am using the reactive rest client and tried to use the @HeaderParam("Authorization") to customize the header:

@Path("/api")
@ApplicationScoped
@RegisterRestClient
@RegisterProvider(value = RestClientExceptionMapper.class)
public interface InternalService {
  @POST
  @Path("/xxx")
  @Produces({APPLICATION_JSON})
  @Consumes({APPLICATION_JSON})
  Uni<List<String>> Abc(
      @HeaderParam("Authorization") String bearerVal,
      List<String> values);
}

It does not work.

On the client side, I can confirm that the bearerVal is correctly set Bearer xxx.

On the server side, I can confirm that the request is received, but the Authorization header value is not set.

I wonder what is missing here? How can I debug the header values used by the the underlying http client?

GeauxEric
  • 2,814
  • 6
  • 26
  • 33

1 Answers1

0

Which version of Quarkus are you using?

If you use version 2.5 or newer, you can enable logging requests and responses with:

quarkus.rest-client.logging.scope=request-response
quarkus.log.category."org.jboss.resteasy.reactive.client.logging".level=DEBUG

For more details, see the Logging traffic section in the REST Client Reactive guide.