Warm tip: This article is reproduced from serverfault.com, please click

Schema.org fails to deliver application/ld+json

发布于 2020-12-17 08:00:04

In my java app I get the following error

Caused by: java.lang.RuntimeException: java.lang.RuntimeException:   
com.github.jsonldjava.core.JsonLdError: loading remote context failed: http://schema.org/

With curl I currently get something like

curl -i -L -k --compressed -H "Accept: application/ld+json" https://schema.org/
HTTP/2 200 
access-control-allow-credentials: true
access-control-allow-headers: Accept
access-control-allow-methods: GET
access-control-allow-origin: *
access-control-expose-headers: Link
link: </docs/jsonldcontext.jsonld>; rel="alternate"; type="application/ld+json"
....
/**   Body contains HTML payload **/
Questioner
jschnasse
Viewed
11
jschnasse 2021-02-10 20:56:29

Content negotiation is not longer supported for the main page. Instead you have to follow the instructions at

https://schema.org/docs/developers.html

and use one of the linked versions:

e.g.

https://schema.org/version/latest/schemaorg-current-http.jsonld

{
    "@context" : "https://schema.org/version/latest/schemaorg-current-http.jsonld"
}

or with curl

curl -i -L https://schema.org/version/latest/schemaorg-current-http.jsonld