You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jena.apache.org by "jmkeil (via GitHub)" <gi...@apache.org> on 2026/01/01 10:19:44 UTC

[I] Provide HTTP Headers in `HttpException` [jena]

jmkeil opened a new issue, #3679:
URL: https://github.com/apache/jena/issues/3679

   ### Version
   
   5.0.0
   
   ### Feature
   
   Hi. Currently, [`HttpException`](https://github.com/apache/jena/blob/b6e6962daeb12ddb2df4672ac7de47c68e8a46a9/jena-arq/src/main/java/org/apache/jena/atlas/web/HttpException.java)s thrown by [`QueryExecHTTP`](https://github.com/apache/jena/blob/b6e6962daeb12ddb2df4672ac7de47c68e8a46a9/jena-arq/src/main/java/org/apache/jena/sparql/exec/http/QueryExecHTTP.java) do not provide access to response headers. This prevents specific handling, like the consideration of [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Retry-After). I suggest to extend `HttpException` with a method `getResponseHeaders()` and an according constructor, and to provide the responses [`HttpHeaders`](https://docs.oracle.com/en/java/javase/17/docs/api/java.net.http/java/net/http/HttpHeaders.html) instance during `HttpException` construction in [`HttpLib#handleHttpStatusCode`](https://github.com/apache/jena/blob/b6e6962daeb12ddb2df4672ac7de47c68e8a46a9/jena-arq/src/main/java/org/apac
 he/jena/http/HttpLib.java#L179) or [`HttpLib#exception`](https://github.com/apache/jena/blob/b6e6962daeb12ddb2df4672ac7de47c68e8a46a9/jena-arq/src/main/java/org/apache/jena/http/HttpLib.java#L279).
   
   ### Are you interested in contributing a solution yourself?
   
   Perhaps?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org


Re: [I] Provide HTTP Headers in `HttpException` [jena]

Posted by "jmkeil (via GitHub)" <gi...@apache.org>.
jmkeil commented on issue #3679:
URL: https://github.com/apache/jena/issues/3679#issuecomment-3705749289

   So `HttpHeaders` would be fine and preferred?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org


Re: [I] Provide HTTP Headers in `HttpException` [jena]

Posted by "jmkeil (via GitHub)" <gi...@apache.org>.
jmkeil commented on issue #3679:
URL: https://github.com/apache/jena/issues/3679#issuecomment-3705436816

   > It is exposing (a small part of) java.net.http at the API level.
   
   Instead of returning `HttpHeaders` itself, the multi map returned by `HttpHeaders#map` could be returned.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org


Re: [I] Provide HTTP Headers in `HttpException` [jena]

Posted by "afs (via GitHub)" <gi...@apache.org>.
afs commented on issue #3679:
URL: https://github.com/apache/jena/issues/3679#issuecomment-3705103356

   Hi @jmkeil ,
   
   Seems reasonable. Another use is getting at header-carried request ids used for tracing.
   
   It is exposing (a small part of) `java.net.http` at the API level. That said, it is possible to construct `HttpHeaders` standalone.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org


Re: [I] Provide HTTP Headers in `HttpException` [jena]

Posted by "afs (via GitHub)" <gi...@apache.org>.
afs closed issue #3679: Provide HTTP Headers in `HttpException`
URL: https://github.com/apache/jena/issues/3679


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org


Re: [I] Provide HTTP Headers in `HttpException` [jena]

Posted by "afs (via GitHub)" <gi...@apache.org>.
afs commented on issue #3679:
URL: https://github.com/apache/jena/issues/3679#issuecomment-3705563053

   > > It is exposing (a small part of) java.net.http at the API level.
   > 
   > Instead of returning `HttpHeaders` itself, the multi map returned by `HttpHeaders#map` could be returned.
   
   True - but the afforance of multimaps is not great, while `HttpHeaders` has a clearly read-only API.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org


Re: [I] Provide HTTP Headers in `HttpException` [jena]

Posted by "jmkeil (via GitHub)" <gi...@apache.org>.
jmkeil commented on issue #3679:
URL: https://github.com/apache/jena/issues/3679#issuecomment-4341914950

   Thank you for solving this, @afs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org