On 10/09/18 16:08, Niraj Patel wrote:
Thank you both for replying!

Can you tell us more about your use case? Are the custom headers for some one 
particular purpose?
Sure! So our database, Allegrograph, allows us to pass down custom headers 
while querying or updating in order to store that information in access logs. 
For each SPARQL request we want to send down unique request markers and 
usernames in order to be able to trace from a UI click to backend calls to 
queries that were performed in the graph. Does that make sense? Do y’all have 
any ideas now that y’all know the use case?

Makes sense.

Adding HTTP header inform to track an operation end-to-end.

What might work is to have a point in the HttpOp execution flow that sees the HttpGet/HttpPost/... request just before it is acted upon.


Niraj Patel
On Sep 9, 2018, 11:58 AM -0500, ajs6f <[email protected]>, wrote:
If the header is going to change on every request, setting default headers may 
not be flexible enough-- the OP would have to change clients for every query.

Yes - but it works on the released version and isn't (I think) too expensive caveat it might break connection caching.


Can you tell us more about your use case? Are the custom headers for some one 
particular purpose?

In a released version, you may have to use your own HTTP client and just let 
Jena build the request bodies and parse the response bodies. We can look at 
adding this to the API in a future release, but I'd like to hear more about the 
use case first.

ajs6f

On Sep 9, 2018, at 12:20 PM, Andy Seaborne <[email protected]> wrote:



On 08/09/18 21:00, Niraj Patel wrote:
Hi!
I am using Jena's QueryEngineHTTP for queries and RemoteUpdateRequest for 
updates. I would like to send a custom header that will differ on each request. 
I did some digging around and it seems like it’s not possible. Using default 
headers when configuring Apache’s Http Client wouldn’t work in this case. Any 
ideas?
Niraj Patel

Hi there,

either create a QueryEngineHTTP directly passing in the required HttpClient 
specially created with setDefaultHeaders(headers)

Also, have a look at the builder for RDFConnections that are remote: 
RDFConnectionRemote.create(RDFConnectionRemote)

What's the use case for the custom header? I'm wondering if it is a usual or 
unusual situation.

Andy


Reply via email to