[ 
https://issues.apache.org/jira/browse/SOLR-13683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16902887#comment-16902887
 ] 

Shalin Shekhar Mangar commented on SOLR-13683:
----------------------------------------------

bq. What is the purpose of this method? 
Http2SolrClient.Builder().withHttpClient(Http2SolrClient httpClient)? Ideally 
this should allow setting Jetty's HttpClient object instead of an instance of 
its own type.

This certainly seems like a mistake. It should just directly accept Jetty's 
HttpClient instead of {{httpClient = builder.http2SolrClient.httpClient;}} that 
it does today in the constructor.

bq. Currently Http2SolrClient does not allow configuring custom headers. For 
example, how to pass Basic Auth headers? It should expose some builder APIs to 
pass such headers.

Actually none of solrj clients allow custom headers directly but you can use 
Apache HttpClient's RequestInterceptors to add custom headers on all requests. 
But if you just want to use basic auth then you can use 
SolrRequest.setBasicAuthCredentials() method to add the user and password. 
These will be base64 encoded and passed to the Authorization header 
automatically by Http2SolrClient.

> SolrJ 8.1.1 Http2SolrClient should allow customizing HTTP headers
> -----------------------------------------------------------------
>
>                 Key: SOLR-13683
>                 URL: https://issues.apache.org/jira/browse/SOLR-13683
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: clients - java
>    Affects Versions: 8.1.1
>            Reporter: Niranjan Nanda
>            Priority: Minor
>
> Currently {{Http2SolrClient}} does not allow configuring custom headers. For 
> example, how to pass Basic Auth headers? It should expose some builder APIs 
> to pass such headers.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to