On 06/12/12 20:49, Stephen Allen wrote:
However perhaps we should be ensuring that everywhere that does anything
HTTP uses the Apache HttpClient as a point of standardization and provide
ways to better expose that up to users to add custom configuration?
On the way to that : the idea of HttpOp is to abstract away from the
choice of HTTP library for many common uses of HTTP in Jena/ARQ.
. Without writing yet another HTTP library or getting into JAR bloat.
HttpOp2 =>
TypedInputStreamHttp execHttpGet(String url, String acceptHeader)
HttpQuery could do with an update to use Apache HttpClient.
((
Fuseki has a simple abstraction of an operation request.
It has it's conneg (one class) which has existed for years.
Must of the real work is not in the general HTTP handling anyway but in
the specifics of writing ResultSets and Model and the protocol extensions.
))
As Andy says patches are welcome in this area. I know I've done some work
in the past to improve configurability on the remote query side but it
still uses the java.net APIs rather than HttpClient as the remote update
stuff does.
HttpClient is nice for what it does, but unfortunately it hides some
of the capabilities of the java.net APIs. In particular for
jena-client, I could not use it because I needed direct access to the
OutputStream for streaming capabilities [1]. The closest you can get
in HttpClient is InputStreamEntity, which would require an inversion
of control and thus a separate thread in some situations
Yes, I found that a nuisance as well - the receive side can be streamed
but the sending side can't. The pain hidden in HTTP is the need to have
retryable operations for authentication or due to temporary failure.
To some extend HTTP, as deployed, is not a streaming protocol. e.g. The
status code of a response has to be first which is a nuisance if
generating the response body might cause an error of some kind. Teh
lack of stream out
I find this permeates the design space - assemble all the content, then
do the operation.
So lucky you can use one API in one place and another API in another.
Andy
-Stephen
[1]
http://svn.apache.org/repos/asf/jena/Experimental/jena-client/src/main/java/org/apache/jena/client/http/HttpUpdater.java