Accept also JSON-LD as content type
Change-Id: I96b06daaa8b3dff5acb16577fd7cfa0822f6a0ff
diff --git a/R/KorAPConnection.R b/R/KorAPConnection.R
index d511d1b..c1c131e 100644
--- a/R/KorAPConnection.R
+++ b/R/KorAPConnection.R
@@ -58,7 +58,7 @@
#' @param url request url
setMethod("apiCall", "KorAPConnection", function(kco, url) {
resp <- GET(url, user_agent(kco@userAgent), timeout(kco@timeout))
- if (http_type(resp) != "application/json") {
+ if (!http_type(resp) %in% c("application/json", "application/ld+json")) {
stop("API did not return json", call. = FALSE)
}
parsed <- jsonlite::fromJSON(content(resp, "text"))