【发布时间】:2017-02-09 10:36:26
【问题描述】:
我正在尝试使用 HTTP 标头,以便我可以验证我的应用程序以查询 ORCID (http://orcid.org) 公共 API。我创建这样的标题:
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
【问题讨论】:
标签: rest http-headers jena