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

Andy Seaborne commented on JENA-1263:
-------------------------------------

(As well as this ...)

I wonder if the default settings for HttpOp ought to be a caching client with 
some low settings, like one host and a time-to-live of a few seconds.

The rational is that many users are aware of the issues around http-connection 
reuse. They are data experts. Overheads of connections creation can be 
significant for repeated calls to the same remote service.

The other view is that the current simple setup is reliable.

(insert analogy to autocommit SQL transactions)


> Configure HTTP client to follow 303 redirects 
> ----------------------------------------------
>
>                 Key: JENA-1263
>                 URL: https://issues.apache.org/jira/browse/JENA-1263
>             Project: Apache Jena
>          Issue Type: Improvement
>          Components: ARQ
>    Affects Versions: Jena 3.1.1
>            Reporter: Aaron Coburn
>            Assignee: A. Soroka
>            Priority: Minor
>             Fix For: Jena 3.2.0
>
>
> When calling RDFDataMgr.read(Model model, String uri), the underlying HTTP 
> client does not appear to follow 303 redirects. For example:
> {code:java}
> Model m = createDefaultModel();
> RDFDataMgr.read(m, "http://purl.org/dc/terms/";);
> {code}
> {code}
> org.apache.jena.riot.RiotException: Failed to determine the content type: 
> (URI=http://purl.org/dc/terms/ : stream=text/html)
> {code}
> A work-around is to add a static block with a custom HTTP client like so:
> {code:java}
> static {
>     HttpOp.setDefaultHttpClient(
>             HttpClientBuilder.create().setRedirectStrategy(
>                     new LaxRedirectStrategy()).build());
> }
> {code}
> By default the Apache HTTP client follows 301 and 302 redirects (but not 303 
> redirects), but the W3C recommends using 303 redirects for publishing RDF 
> vocabularies (https://www.w3.org/TR/swbp-vocab-pub/), which is what the 
> Dublin Core vocabularies use.
> This sort of redirect handling worked previously, e.g. Jena 3.1.0; it would 
> be convenient if the underlying HTTP client simply followed the 303 redirects.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to