Hey,
I know changes were introduced (and bugs fixed) in this area, but I'm
having trouble getting update requests to work with HTTP Basic
authentication.
This code should send authenticated INSERT to Dydra:
UpdateRequest update = UpdateFactory.create(uString);
UpdateProcessRemote updateProcess = (UpdateProcessRemote)
UpdateExecutionFactory.createRemote(update,
"http://dydra.com/user/mycompany/sparql");
updateProcess.setAuthentication("[email protected]",
"zzz".toCharArray());
updateProcess.execute();
and logs the following output:
00:56:45,972 DEBUG DefaultClientConnectionOperator:177 - Connecting to
dydra.com:80
00:56:46,000 DEBUG RequestAddCookies:132 - CookieSpec selected: best-match
00:56:46,016 DEBUG RequestAuthCache:78 - Auth cache not set in the context
00:56:46,016 DEBUG RequestTargetAuthentication:78 - Target auth state:
UNCHALLENGED
00:56:46,017 DEBUG RequestProxyAuthentication:87 - Proxy auth state:
UNCHALLENGED
00:56:46,017 DEBUG SystemDefaultHttpClient:715 - Attempt 1 to execute request
00:56:46,018 DEBUG DefaultClientConnection:269 - Sending request: POST
/user/mycompany/sparql HTTP/1.1
00:56:46,018 DEBUG wire:63 - >> "POST /user/mycompany/sparql HTTP/1.1[\r][\n]"
00:56:46,020 DEBUG wire:63 - >> "Content-Length: 175[\r][\n]"
00:56:46,020 DEBUG wire:63 - >> "Content-Type:
application/sparql-update[\r][\n]"
00:56:46,020 DEBUG wire:63 - >> "Host: dydra.com[\r][\n]"
00:56:46,021 DEBUG wire:63 - >> "Connection: Keep-Alive[\r][\n]"
00:56:46,021 DEBUG wire:63 - >> "User-Agent: Apache-HttpClient/4.2.3
(java 1.5)[\r][\n]"
00:56:46,021 DEBUG wire:63 - >> "[\r][\n]"
00:56:46,021 DEBUG headers:273 - >> POST /user/mycompany/sparql HTTP/1.1
00:56:46,021 DEBUG headers:276 - >> Content-Length: 175
00:56:46,022 DEBUG headers:276 - >> Content-Type: application/sparql-update
00:56:46,022 DEBUG headers:276 - >> Host: dydra.com
00:56:46,022 DEBUG headers:276 - >> Connection: Keep-Alive
00:56:46,022 DEBUG headers:276 - >> User-Agent:
Apache-HttpClient/4.2.3 (java 1.5)
00:56:46,023 DEBUG wire:63 - >> "INSERT DATA {[\n]"
It does not seem that the Authorization header is present in the request?
Martynas
graphityhq.com