use of org.hl7.fhir.utilities.SimpleHTTPClient.HTTPResult in project org.hl7.fhir.core by hapifhir.
the class NpmPackage method fromUrl.
public static NpmPackage fromUrl(String source) throws IOException {
SimpleHTTPClient fetcher = new SimpleHTTPClient();
HTTPResult res = fetcher.get(source + "?nocache=" + System.currentTimeMillis());
res.checkThrowException();
return fromPackage(new ByteArrayInputStream(res.getContent()));
}
use of org.hl7.fhir.utilities.SimpleHTTPClient.HTTPResult in project org.hl7.fhir.core by hapifhir.
the class PackageClient method fetchUrl.
private InputStream fetchUrl(String source, String accept) throws IOException {
SimpleHTTPClient http = new SimpleHTTPClient();
HTTPResult res = http.get(source, accept);
res.checkThrowException();
return new ByteArrayInputStream(res.getContent());
}
use of org.hl7.fhir.utilities.SimpleHTTPClient.HTTPResult in project org.hl7.fhir.core by hapifhir.
the class ICD11Generator method fetchJson.
private JsonObject fetchJson(String source) throws IOException {
SimpleHTTPClient http = new SimpleHTTPClient();
http.addHeader("API-Version", "v2");
http.addHeader("Accept-Language", "en");
HTTPResult res = http.get(source, "application/json");
res.checkThrowException();
return JsonTrackingParser.parseJson(res.getContent());
}
use of org.hl7.fhir.utilities.SimpleHTTPClient.HTTPResult in project org.hl7.fhir.core by hapifhir.
the class CKMImporter method loadXml.
private Document loadXml(String address) throws Exception {
SimpleHTTPClient http = new SimpleHTTPClient();
HTTPResult res = http.get(address, "application/xml");
res.checkThrowException();
InputStream xml = new ByteArrayInputStream(res.getContent());
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
return db.parse(xml);
}
use of org.hl7.fhir.utilities.SimpleHTTPClient.HTTPResult in project org.hl7.fhir.core by hapifhir.
the class ValidationEngine method fetchRaw.
@Override
public byte[] fetchRaw(IResourceValidator validator, String source) throws IOException {
SimpleHTTPClient http = new SimpleHTTPClient();
HTTPResult res = http.get(source);
res.checkThrowException();
return res.getContent();
}
Aggregations