0
我正在嘗試使用HTTP標頭,以便我可以驗證我的應用程序以查詢ORCID(http://orcid.org)公共API。我創建這樣的標題:如何將http標頭添加到Apache Jena QueryEngineHTTP查詢?
HttpOptions httpOptions = new HttpOptions();
Header contentTypeHeader = new BasicHeader("Content-Type", "application/orcid+json");
Header authorizationHeader = new BasicHeader("Authorization", "Bearer 5266384f-0567-43f0-9cd4-bc6f6a5dc3ea");
Header[] headers = new Header[2];
headers[1] = contentTypeHeader;
headers[2] = authorizationHeader;
httpOptions.setHeaders(headers);
但我不知道如何將這些標題放到我的查詢中。我在寫我的查詢是這樣的:
QueryExecution execution = new QueryEngineHTTP(endpoint, query);
使用org.apache.jena.sparql.engine.http.QueryEngineHTTP