From 7c2c44b333402a404ea87903bce2987bbc4321c5 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 9 Dec 2022 20:09:12 +1100 Subject: [PATCH] Add Accept header fetching JSON --- .../main/java/org/hl7/fhir/utilities/json/parser/JsonParser.java | 1 + 1 file changed, 1 insertion(+) diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/json/parser/JsonParser.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/json/parser/JsonParser.java index 931536548..fa7745cdf 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/json/parser/JsonParser.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/json/parser/JsonParser.java @@ -653,6 +653,7 @@ public class JsonParser { private static byte[] fetch(String source) throws IOException { SimpleHTTPClient fetcher = new SimpleHTTPClient(); + fetcher.addHeader("Accept", "application/json, application/fhir+json"); HTTPResult res = fetcher.get(source+"?nocache=" + System.currentTimeMillis()); res.checkThrowException(); return res.getContent();