Mohamed BEN ELLEFI created JENA-2255:
----------------------------------------

             Summary: Setting content type in Jena RDFConnection Header ?
                 Key: JENA-2255
                 URL: https://issues.apache.org/jira/browse/JENA-2255
             Project: Apache Jena
          Issue Type: Question
          Components: Jena
            Reporter: Mohamed BEN ELLEFI


Hello,
I need to modify the header (specifically the Content-Type) of a request (eg: 
update) of an RDFConnection object in a Jena transaction. More precisely, I 
need to add the following Header Content_Type {{Content-Type = 
[application/sparql-query; charset=UTF-8]}}

in the following code
{code:java}
try (RDFConnection conn = connectionFactory.create()) { 
Txn.executeWrite(conn, () -> { 

conn.update(updateRequest);// HERE we want to setup the Content-Type in the 
header 

}); 
}catch (Exception e) {... }{code}
 
I have setup the connectionFactory as follow
    HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
    HttpClient httpClient = 
httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider)
        .build();
    return
        RDFConnectionRemote.create()
        .destination(endpointURL)
        .queryEndpoint("query")
        .updateEndpoint("update")
        .httpClient(httpClient)
        .parseCheckSPARQL(true)
        .build();
  }

So, I still need to specify the charset of the request body in the the request 
header content-Type . How can I do that with JENA ?

Note: the default JENA RDFConnection setting is not sufficient because the 
remote endpoint still needs the explicit specification of the charset to parse 
my SPARQL requests containing French accents in the URIs.

Thanks in advance

stackoverflow : 
[https://stackoverflow.com/questions/70742161/setting-content-type-in-jena-rdfconnection-header|http://example.com]



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to