You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by 刑天 <ga...@163.com> on 2019/05/23 08:05:42 UTC

How can I dynamically set http headers using RDFConnectionRemote

I'm using RDFConnectionRemote via Spring as a singleton component, I'm designing a http proxy which redirect query through http header. So I want to dynamically set http headers for every query I issued. How can I do that?

Re: How can I dynamically set http headers using RDFConnectionRemote

Posted by Andy Seaborne <an...@apache.org>.

On 23/05/2019 09:05, 刑天 wrote:
> I'm using RDFConnectionRemote via Spring as a singleton component, I'm designing a http proxy which redirect query through http header. So I want to dynamically set http headers for every query I issued. How can I do that?
> 

Hi there,

RDFConnectionRemote is built around a HttpClient from Apache HttpClient. 
HttpClient objects are built with a fixed configuration.

Like wise the configuration for RDFConnectionRemote is set when built 
and remains fixed for the lifetime of the connection.

You can
(1) build a RDFConnectionRemote for different settings (they are not 
expensive to build).

(2) use the lower level code such as QueryExecutionFactory.sparqlService 
and UpdateExecutionFactory.createRemote

Or use the implement code like QueryEngineHTTP.setClient but that is 
digging into the implementation.

     Andy